Android-javaee
This commit is contained in:
parent
657e9578cb
commit
f2dea2e506
|
@ -1,6 +1,7 @@
|
|||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Att;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.service.IAttService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xiao
|
||||
|
@ -23,10 +24,31 @@ public class AttController {
|
|||
|
||||
@Autowired
|
||||
public IAttService attService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/att")
|
||||
public List att(){
|
||||
List<Att> list = attService.list();
|
||||
return list;
|
||||
public Result att() {
|
||||
List<Att> list = attService.list();
|
||||
return Result.ok().put("data", list);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/editAtt")
|
||||
public Result editAtt(Att att) {
|
||||
boolean edit = attService.saveOrUpdate(att);
|
||||
if (edit) {
|
||||
return Result.ok("修改成功");
|
||||
}
|
||||
return Result.error("修改失败");
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/delAtt")
|
||||
public Result delAtt(Integer id) {
|
||||
boolean del = attService.removeById(id);
|
||||
if (del) {
|
||||
return Result.ok("删除成功");
|
||||
}
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.service.IFindService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -10,7 +11,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xiao
|
||||
|
@ -21,10 +22,31 @@ import java.util.List;
|
|||
public class FindController {
|
||||
@Autowired
|
||||
public IFindService findService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/find")
|
||||
public List find(){
|
||||
List<com.xiaoshuai.c202201020323.smallcourse.model.Find> list = findService.list();
|
||||
return list;
|
||||
public Result find() {
|
||||
List<com.xiaoshuai.c202201020323.smallcourse.model.Find> list = findService.list();
|
||||
return Result.ok().put("data", list);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/editFind")
|
||||
public Result editFind(com.xiaoshuai.c202201020323.smallcourse.model.Find find) {
|
||||
boolean edit = findService.saveOrUpdate(find);
|
||||
if (edit) {
|
||||
return Result.ok();
|
||||
}
|
||||
return Result.error();
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/delFind")
|
||||
public Result delFind(Integer id) {
|
||||
boolean del = findService.removeById(id);
|
||||
if (del) {
|
||||
return Result.ok();
|
||||
}
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Model;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.service.IModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xiao
|
||||
|
@ -22,10 +23,31 @@ import java.util.List;
|
|||
public class ModelController {
|
||||
@Autowired
|
||||
public IModelService modelService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/model")
|
||||
public List model(){
|
||||
List<Model> list = modelService.list();
|
||||
return list;
|
||||
public Result model() {
|
||||
List<Model> list = modelService.list();
|
||||
return Result.ok().put("data", list);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/editModel")
|
||||
public Result editModel(Model model) {
|
||||
boolean edit = modelService.saveOrUpdate(model);
|
||||
if (edit) {
|
||||
return Result.ok("修改成功");
|
||||
}
|
||||
return Result.error("修改失败");
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/delModel")
|
||||
public Result delModel(Integer id) {
|
||||
boolean del = modelService.removeById(id);
|
||||
if (del) {
|
||||
return Result.ok("删除成功");
|
||||
}
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.MyselfCity;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.service.IMyselfCityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -10,7 +12,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xiao
|
||||
|
@ -21,10 +23,31 @@ import java.util.List;
|
|||
public class MyselfCityController {
|
||||
@Autowired
|
||||
public IMyselfCityService myselfCityService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/myselfCity")
|
||||
public List myselfCity(){
|
||||
List<com.xiaoshuai.c202201020323.smallcourse.model.MyselfCity> list = myselfCityService.list();
|
||||
return list;
|
||||
public Result myselfCity() {
|
||||
List<com.xiaoshuai.c202201020323.smallcourse.model.MyselfCity> list = myselfCityService.list();
|
||||
return Result.ok().put("data", list);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/editMyselfCity")
|
||||
public Result editMyselfCity(MyselfCity myselfCity) {
|
||||
boolean edit = myselfCityService.saveOrUpdate(myselfCity);
|
||||
if (edit) {
|
||||
return Result.ok("修改成功");
|
||||
}
|
||||
return Result.error("修改失败");
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/delMyselfCity")
|
||||
public Result delMyselfCity(Integer id) {
|
||||
boolean del = myselfCityService.removeById(id);
|
||||
if (del) {
|
||||
return Result.ok("删除成功");
|
||||
}
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.model.School;
|
||||
import com.xiaoshuai.c202201020323.smallcourse.service.ISchoolService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xiao
|
||||
|
@ -22,10 +23,33 @@ import java.util.List;
|
|||
public class SchoolController {
|
||||
@Autowired
|
||||
public ISchoolService schoolService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/school")
|
||||
public List school(){
|
||||
List<School> list = schoolService.list();
|
||||
return list;
|
||||
public Result school() {
|
||||
List<School> list = schoolService.list();
|
||||
return Result.ok().put("data", list);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/editSchool")
|
||||
public Result editSchool(School school) {
|
||||
boolean edit = schoolService.saveOrUpdate(school);
|
||||
if (edit) {
|
||||
return Result.ok();
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/delSchool")
|
||||
public Result delSchool(Integer id) {
|
||||
boolean del = schoolService.removeById(id);
|
||||
if (del) {
|
||||
return Result.ok();
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue