| | |
| | | package com.zy.acs.manager.fake; |
| | | |
| | | import com.zy.acs.framework.common.BaseRes; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.system.controller.BaseController; |
| | | import com.zy.acs.manager.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | /** |
| | | * Created by vincent on 11/9/2024 |
| | |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | @GetMapping("/sign") |
| | | public R sign() { |
| | | @PostConstruct |
| | | public void init() { |
| | | configService.setVal("fakeSign", Boolean.FALSE); |
| | | } |
| | | |
| | | @GetMapping("/sign/get") |
| | | public R getSign() { |
| | | return R.ok().add(configService.getVal("fakeSign", Boolean.class)); |
| | | } |
| | | |
| | | @PostMapping("/sign/set") |
| | | public synchronized R setSign(@RequestParam(required = false) Boolean sign) { |
| | | if (Cools.isEmpty(sign)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | boolean res = configService.setVal("fakeSign", sign); |
| | | if (!res) { |
| | | return R.error(); |
| | | } |
| | | return R.ok().add(configService.getVal("fakeSign", Boolean.class)); |
| | | } |
| | | |