UserRelationController.java
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.glsx.smart.controller;
import com.alibaba.fastjson.JSON;
import com.glsx.smart.dao.entity.SmartUserRelation;
import com.glsx.smart.service.SmartUserRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Title: UserRelationController.java
* @Description:用户关系控制类
* @author think.wang
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
@RestController
@RequestMapping("/user")
public class UserRelationController {
@Autowired
private SmartUserRelationService userRelationService;
@ResponseBody
@RequestMapping(value = "/getSingle", method = {RequestMethod.POST})
public SmartUserRelation getSingle(@RequestBody SmartUserRelation userRelation){
return userRelationService.getSingle(userRelation);
}
@ResponseBody
@RequestMapping(value = "/add", method = {RequestMethod.POST})
public Long add(@RequestBody SmartUserRelation userRelation){
log.info("/user/add保存数据参数:{}", JSON.toJSONString(userRelation));
return userRelationService.insertSelective(userRelation);
}
@ResponseBody
@RequestMapping(value = "/update", method = {RequestMethod.POST})
public Integer update(@RequestBody SmartUserRelation userRelation){
log.info("/user/update保存数据参数:{}", JSON.toJSONString(userRelation));
return userRelationService.updateByPrimaryKeySelective(userRelation);
}
}