package com.ym.controller;

import com.ym.service.UserService;
import io.rong.models.user.BatchTagModel;
import io.rong.models.user.GetTagModel;
import io.rong.models.user.TagModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by weiqinxiao on 2019/2/25.
 */
@RestController
@RequestMapping("/tag")
public class TagController {

    @Autowired
    UserService userService;

    @RequestMapping(value = "/set", method = RequestMethod.POST)
    public Object add(@RequestBody TagModel tagModel) throws Exception {
        return userService.tagSet(tagModel);
    }

    @RequestMapping(value = "/batchSet", method = RequestMethod.POST)
    public Object remove(@RequestBody BatchTagModel batchTagModel) throws Exception {
        return userService.tagBatchSet(batchTagModel);
    }

    @RequestMapping(value = "/get", method = RequestMethod.POST)
    public Object getList(GetTagModel getTagModel) throws Exception {
        return userService.tagGet(getTagModel);
    }
}
