mybatis-plus
This commit is contained in:
@@ -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) {
|
||||
|
18
src/main/java/com/dota/nexus/Solution.java
Normal file
18
src/main/java/com/dota/nexus/Solution.java
Normal 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);
|
||||
}
|
||||
}
|
16
src/main/java/com/dota/nexus/entity/Entity.java
Normal file
16
src/main/java/com/dota/nexus/entity/Entity.java
Normal 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;
|
||||
}
|
14
src/main/java/com/dota/nexus/entity/Goal.java
Normal file
14
src/main/java/com/dota/nexus/entity/Goal.java
Normal 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;
|
||||
}
|
9
src/main/java/com/dota/nexus/mapper/GoalMapper.java
Normal file
9
src/main/java/com/dota/nexus/mapper/GoalMapper.java
Normal 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> {
|
||||
}
|
7
src/main/java/com/dota/nexus/service/GoalService.java
Normal file
7
src/main/java/com/dota/nexus/service/GoalService.java
Normal 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> {
|
||||
}
|
@@ -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 {
|
||||
|
||||
}
|
Reference in New Issue
Block a user