package com.zd.laboratory.controller;

import com.zd.common.core.domain.R;
import com.zd.common.log.annotation.Log;
import com.zd.common.log.enums.BusinessType;
import com.zd.laboratory.domain.LabMessageDynamic;
import com.zd.laboratory.service.ILabMessageDynamicService;
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;

@RestController
@RequestMapping("/dynamic")
public class LabMessageDynamicController {

    @Autowired
    private ILabMessageDynamicService labMessageDynamicService;


    @Log(title = "可读消息新增", businessType = BusinessType.INSERT)
    @PostMapping("/addMessage")
    public R addMessage(@RequestBody LabMessageDynamic labMessageDynamic) {
        return R.ok(labMessageDynamicService.addMessageAndUser(labMessageDynamic));
    }
}
