package com.salpa.web.controller.subject;

import com.salpa.common.core.controller.BaseController;
import com.salpa.common.core.domain.AjaxResult;
import com.salpa.common.core.domain.entity.SysUser;
import com.salpa.common.utils.SecurityUtils;
import com.salpa.subject.domain.MonitorDocumentDescription;
import com.salpa.subject.service.DocumentDescriptionService;
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("/subject/documentDescription")
public class DocumentDescriptionController extends BaseController {

    @Autowired
    private DocumentDescriptionService documentDescriptionService;

    /**
     * 修改描述
     * @author rhl
     * @param monitorDocumentDescription
     * @return
     */
    @PostMapping("update")
    public AjaxResult updateDescription(@RequestBody MonitorDocumentDescription monitorDocumentDescription){
        SysUser user = SecurityUtils.getLoginUser().getUser();
        monitorDocumentDescription.setUpdateBy(user.getUserId());
        System.out.println(monitorDocumentDescription);
        return AjaxResult.success(documentDescriptionService.updateDescription(monitorDocumentDescription));
    }
}
