package cn.pluss.platform.controller;

import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.user.UserPushIdService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author djh
 */
@RestController
@RequestMapping("/userPushId")
public class UserPushIdController {

    @Autowired
    private UserPushIdService userPushIdService;

    @PostMapping("/cid")
    public Result<Object> setCid(@RequestBody JSONObject param) {
        String cid = param.getString("cid");
        userPushIdService.apiSetCid(cid);

        return ResultGenerator.genSuccessResult();
    }
}
