-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
2,030 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
business/src/main/java/com/pds/business/controller/admin/TrainAdminController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.pds.business.controller.admin; | ||
|
||
|
||
import com.pds.business.req.TrainQueryReq; | ||
import com.pds.business.req.TrainSaveReq; | ||
import com.pds.business.resp.TrainQueryResp; | ||
import com.pds.business.service.TrainService; | ||
import com.pds.common.resp.CommonResp; | ||
import com.pds.common.resp.PageResp; | ||
import jakarta.annotation.Resource; | ||
import jakarta.validation.Valid; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
// 所有的管理控制台的请求带上admin 方便统一拦截或者放行 | ||
@RestController | ||
@RequestMapping("/admin/train") | ||
public class TrainAdminController { | ||
@Resource | ||
private TrainService trainService; | ||
|
||
|
||
@PostMapping("/save") | ||
public CommonResp<Object> save(@Valid @RequestBody TrainSaveReq req) { | ||
trainService.save(req); | ||
return new CommonResp<>(); | ||
} | ||
|
||
|
||
@GetMapping("/query-list") | ||
public CommonResp<PageResp<TrainQueryResp>> queryList(@Valid TrainQueryReq req) { | ||
PageResp<TrainQueryResp> list = trainService.queryList(req); | ||
return new CommonResp<>(list); | ||
} | ||
|
||
@DeleteMapping("/delete/{id}") | ||
public CommonResp<Object> delete(@PathVariable Long id) { | ||
trainService.delete(id); | ||
return new CommonResp<>(); | ||
} | ||
|
||
@GetMapping("/query-all") | ||
public CommonResp<List<TrainQueryResp>> queryList() { | ||
List<TrainQueryResp> list = trainService.queryAll(); | ||
return new CommonResp<>(list); | ||
} | ||
|
||
|
||
|
||
|
||
} |
136 changes: 136 additions & 0 deletions
136
business/src/main/java/com/pds/business/domain/Train.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package com.pds.business.domain; | ||
|
||
import java.util.Date; | ||
|
||
public class Train { | ||
private Long id; | ||
|
||
private String code; | ||
|
||
private String type; | ||
|
||
private String start; | ||
|
||
private String startPinyin; | ||
|
||
private Date startTime; | ||
|
||
private String end; | ||
|
||
private String endPinyin; | ||
|
||
private Date endTime; | ||
|
||
private Date createTime; | ||
|
||
private Date updateTime; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public void setCode(String code) { | ||
this.code = code; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public String getStart() { | ||
return start; | ||
} | ||
|
||
public void setStart(String start) { | ||
this.start = start; | ||
} | ||
|
||
public String getStartPinyin() { | ||
return startPinyin; | ||
} | ||
|
||
public void setStartPinyin(String startPinyin) { | ||
this.startPinyin = startPinyin; | ||
} | ||
|
||
public Date getStartTime() { | ||
return startTime; | ||
} | ||
|
||
public void setStartTime(Date startTime) { | ||
this.startTime = startTime; | ||
} | ||
|
||
public String getEnd() { | ||
return end; | ||
} | ||
|
||
public void setEnd(String end) { | ||
this.end = end; | ||
} | ||
|
||
public String getEndPinyin() { | ||
return endPinyin; | ||
} | ||
|
||
public void setEndPinyin(String endPinyin) { | ||
this.endPinyin = endPinyin; | ||
} | ||
|
||
public Date getEndTime() { | ||
return endTime; | ||
} | ||
|
||
public void setEndTime(Date endTime) { | ||
this.endTime = endTime; | ||
} | ||
|
||
public Date getCreateTime() { | ||
return createTime; | ||
} | ||
|
||
public void setCreateTime(Date createTime) { | ||
this.createTime = createTime; | ||
} | ||
|
||
public Date getUpdateTime() { | ||
return updateTime; | ||
} | ||
|
||
public void setUpdateTime(Date updateTime) { | ||
this.updateTime = updateTime; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append(getClass().getSimpleName()); | ||
sb.append(" ["); | ||
sb.append("Hash = ").append(hashCode()); | ||
sb.append(", id=").append(id); | ||
sb.append(", code=").append(code); | ||
sb.append(", type=").append(type); | ||
sb.append(", start=").append(start); | ||
sb.append(", startPinyin=").append(startPinyin); | ||
sb.append(", startTime=").append(startTime); | ||
sb.append(", end=").append(end); | ||
sb.append(", endPinyin=").append(endPinyin); | ||
sb.append(", endTime=").append(endTime); | ||
sb.append(", createTime=").append(createTime); | ||
sb.append(", updateTime=").append(updateTime); | ||
sb.append("]"); | ||
return sb.toString(); | ||
} | ||
} |
Oops, something went wrong.