package com.fgkj.controller;
|
|
import com.fgkj.dto.Chart_Color;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.User_inf;
|
import com.fgkj.services.Chart_ColorService;
|
import com.fgkj.util.ActionUtil;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
@RequestMapping("chartColor")
|
@RestController
|
@Api(tags = "chartColor接口")
|
public class Chart_ColorController{
|
|
@Resource
|
private Chart_ColorService service;
|
|
//修改用户的颜色组
|
@PutMapping("/")
|
@ApiOperation(notes = "",value="修改用户的颜色组")
|
public ServiceModel update(@RequestBody Chart_Color ccolor) {
|
// Chart_Color ccolor=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Chart_Color.class);
|
Object obj = ActionUtil.getUser();
|
ServiceModel model = new ServiceModel();
|
if(obj != null){
|
User_inf user = (User_inf)obj;
|
ccolor.setuId(user.getuId());
|
model=service.update(ccolor);
|
}else{
|
model.setCode(0);
|
model.setMsg("失败,用户未登录");
|
}
|
|
return model;
|
}
|
|
//查询用户对应得颜色组
|
@GetMapping("byCondition")
|
@ApiOperation(notes = "",value="查询用户对应得颜色组")
|
public ServiceModel serchByCondition() {
|
User_inf user = (User_inf) ActionUtil.getUser();
|
ServiceModel model = new ServiceModel();
|
if(user!=null){
|
Chart_Color ccolor = new Chart_Color();
|
ccolor.setuId(user.getuId());
|
model = service.serchByCondition(ccolor);
|
}else{
|
model.setCode(0);
|
model.setMsg("失败,用户未登录");
|
}
|
|
return model;
|
}
|
|
}
|