mybatis-plus

This commit is contained in:
jsh
2025-10-08 09:50:13 +08:00
parent fe06b792b3
commit a5e629cbbd
11 changed files with 131 additions and 3 deletions

View File

@@ -1,9 +1,11 @@
package com.dota.nexus;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("com.dota.nexus.mapper")
public class NexusApplication {
public static void main(String[] args) {

View File

@@ -0,0 +1,18 @@
package com.dota.nexus;
class Solution {
public boolean canReach(int[] arr, int start) {
int n = arr.length;
var book = new boolean[n];
return dfs(arr, start,book);
}
boolean dfs(int[] arr, int idx, boolean[] book) {
if (idx <0 || idx >= arr.length || book[idx]) {
return false;
}
book[idx] = true;
if (arr[idx] == 0) return true;
return dfs(arr, idx + arr[idx], book) || dfs(arr, idx - arr[idx],book);
}
}

View File

@@ -0,0 +1,16 @@
package com.dota.nexus.entity;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class Entity {
Integer id;
Integer status;
LocalDateTime createTime;
LocalDateTime updateTime;
}

View File

@@ -0,0 +1,14 @@
package com.dota.nexus.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class Goal extends Entity {
private String name;
private String tag;
private String detail;
}

View File

@@ -0,0 +1,9 @@
package com.dota.nexus.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dota.nexus.entity.Goal;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface GoalMapper extends BaseMapper<Goal> {
}

View File

@@ -0,0 +1,7 @@
package com.dota.nexus.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dota.nexus.entity.Goal;
public interface GoalService extends IService<Goal> {
}

View File

@@ -0,0 +1,10 @@
package com.dota.nexus.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dota.nexus.entity.Goal;
import com.dota.nexus.mapper.GoalMapper;
import com.dota.nexus.service.GoalService;
public class GoalServiceImpl extends ServiceImpl<GoalMapper, Goal> implements GoalService {
}