Android-javaee
This commit is contained in:
parent
657e9578cb
commit
f2dea2e506
|
@ -1,6 +1,7 @@
|
||||||
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||||
|
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.model.Att;
|
import com.xiaoshuai.c202201020323.smallcourse.model.Att;
|
||||||
|
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.service.IAttService;
|
import com.xiaoshuai.c202201020323.smallcourse.service.IAttService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author xiao
|
* @author xiao
|
||||||
|
@ -23,10 +24,31 @@ public class AttController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public IAttService attService;
|
public IAttService attService;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/att")
|
@RequestMapping("/att")
|
||||||
public List att(){
|
public Result att() {
|
||||||
List<Att> list = attService.list();
|
List<Att> list = attService.list();
|
||||||
return 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;
|
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||||
|
|
||||||
|
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.service.IFindService;
|
import com.xiaoshuai.c202201020323.smallcourse.service.IFindService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -10,7 +11,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author xiao
|
* @author xiao
|
||||||
|
@ -21,10 +22,31 @@ import java.util.List;
|
||||||
public class FindController {
|
public class FindController {
|
||||||
@Autowired
|
@Autowired
|
||||||
public IFindService findService;
|
public IFindService findService;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/find")
|
@RequestMapping("/find")
|
||||||
public List find(){
|
public Result find() {
|
||||||
List<com.xiaoshuai.c202201020323.smallcourse.model.Find> list = findService.list();
|
List<com.xiaoshuai.c202201020323.smallcourse.model.Find> list = findService.list();
|
||||||
return 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;
|
package com.xiaoshuai.c202201020323.smallcourse.controller;
|
||||||
|
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.model.Model;
|
import com.xiaoshuai.c202201020323.smallcourse.model.Model;
|
||||||
|
import com.xiaoshuai.c202201020323.smallcourse.model.Result;
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.service.IModelService;
|
import com.xiaoshuai.c202201020323.smallcourse.service.IModelService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author xiao
|
* @author xiao
|
||||||
|
@ -22,10 +23,31 @@ import java.util.List;
|
||||||
public class ModelController {
|
public class ModelController {
|
||||||
@Autowired
|
@Autowired
|
||||||
public IModelService modelService;
|
public IModelService modelService;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/model")
|
@RequestMapping("/model")
|
||||||
public List model(){
|
public Result model() {
|
||||||
List<Model> list = modelService.list();
|
List<Model> list = modelService.list();
|
||||||
return 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;
|
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 com.xiaoshuai.c202201020323.smallcourse.service.IMyselfCityService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -10,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author xiao
|
* @author xiao
|
||||||
|
@ -21,10 +23,31 @@ import java.util.List;
|
||||||
public class MyselfCityController {
|
public class MyselfCityController {
|
||||||
@Autowired
|
@Autowired
|
||||||
public IMyselfCityService myselfCityService;
|
public IMyselfCityService myselfCityService;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/myselfCity")
|
@RequestMapping("/myselfCity")
|
||||||
public List myselfCity(){
|
public Result myselfCity() {
|
||||||
List<com.xiaoshuai.c202201020323.smallcourse.model.MyselfCity> list = myselfCityService.list();
|
List<com.xiaoshuai.c202201020323.smallcourse.model.MyselfCity> list = myselfCityService.list();
|
||||||
return 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;
|
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.model.School;
|
||||||
import com.xiaoshuai.c202201020323.smallcourse.service.ISchoolService;
|
import com.xiaoshuai.c202201020323.smallcourse.service.ISchoolService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author xiao
|
* @author xiao
|
||||||
|
@ -22,10 +23,33 @@ import java.util.List;
|
||||||
public class SchoolController {
|
public class SchoolController {
|
||||||
@Autowired
|
@Autowired
|
||||||
public ISchoolService schoolService;
|
public ISchoolService schoolService;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/school")
|
@RequestMapping("/school")
|
||||||
public List school(){
|
public Result school() {
|
||||||
List<School> list = schoolService.list();
|
List<School> list = schoolService.list();
|
||||||
return 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