44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
package com.bashi.dk.controller;
|
|
|
|
import com.bashi.common.annotation.Log;
|
|
import com.bashi.common.annotation.RepeatSubmit;
|
|
import com.bashi.common.core.controller.BaseController;
|
|
import com.bashi.common.core.domain.AjaxResult;
|
|
import com.bashi.common.enums.BusinessType;
|
|
import com.bashi.dk.domain.AgreementSetting;
|
|
import com.bashi.dk.service.AgreementSettingService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
@RestController
|
|
@RequestMapping("/dk/AgreementSetting")
|
|
public class DkAgreementSettingController extends BaseController {
|
|
|
|
private final AgreementSettingService agreementSettingService;
|
|
|
|
/**
|
|
* 获取协议设置详细信息
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('dk:AgreementSetting:query')")
|
|
@GetMapping("/info")
|
|
public AjaxResult<AgreementSetting> getInfo() {
|
|
return AjaxResult.success(agreementSettingService.getAgreementSetting());
|
|
}
|
|
|
|
/**
|
|
* 修改协议设置
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('dk:AgreementSetting:edit')")
|
|
@Log(title = "协议设置", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit
|
|
@PutMapping()
|
|
public AjaxResult<Void> edit(@Validated @RequestBody AgreementSetting bo) {
|
|
return toAjax(agreementSettingService.updateById(bo) ? 1 : 0);
|
|
}
|
|
|
|
}
|