package com.playlet.web.controller.app;

import com.alibaba.fastjson.JSONObject;
import com.playlet.common.core.domain.Result;
import com.playlet.system.domain.PublicDetailShare;
import com.playlet.web.service.app.PublicDetailShareAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Api(tags = "公众号*用户分享记录接口")
@RestController
@RequestMapping(value = "/app/public/share")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PublicDetailShareAppController {

    private final PublicDetailShareAppService publicDetailShareAppService;

    @ResponseBody
    @PostMapping("/add")
    @ApiOperation(value = "新增用户分享记录")
    public Result<String> addRecord(@RequestBody PublicDetailShare publicDetailShare) {
        log.info("新增用户分享记录,入参:{}", JSONObject.toJSONString(publicDetailShare));
        publicDetailShareAppService.addRecord(publicDetailShare);
        return Result.success();
    }

}
