| | |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.system.domain.dto.SysAgreementDTO; |
| | | import com.sinata.system.domain.vo.SysAgreementVO; |
| | | import com.sinata.system.service.SysAgreementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/sysAgreement") |
| | | public class SysAgreementController { |
| | | private SysAgreementService sysAgreementService; |
| | | private final SysAgreementService sysAgreementService; |
| | | |
| | | /** |
| | | * 根据类型获取协议内容 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ApiOperation("根据类型获取协议内容") |
| | | @GetMapping("/{type}") |
| | | public R<SysAgreementVO> getAgreementByType(@ApiParam(name = "type", value = "协议类型 1:用户注册协议;2:用户隐私协议") @PathVariable("type") Integer type) { |
| | | return R.ok(sysAgreementService.getAgreementByType(type)); |
| | | } |
| | | /** |
| | | * 保存用户注册协议 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("保存用户注册协议") |
| | | @ApiOperation("保存协议") |
| | | @PostMapping("/save") |
| | | public R<?> save(@Valid @RequestBody SysAgreementDTO dto){ |
| | | sysAgreementService.saveAgreement(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |