1
zj
2026-03-23 efb07bcec37c49228d9760794f215c8549243ad2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.nq.controller.backend;
 
import com.nq.common.ServerResponse;
import com.nq.service.ISitePayOptionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import java.util.List;
 
/**
 * 管理后台 - 支付设置(默认/支付1/支付2/支付3)
 * 支持拖拽排序(参数随排序变动)、开启/关闭
 */
@Controller
@RequestMapping("/admin/payOption/")
public class AdminSitePayOptionController {
    private static final Logger log = LoggerFactory.getLogger(AdminSitePayOptionController.class);
 
    @Autowired
    private ISitePayOptionService sitePayOptionService;
 
    /** 列表(按当前排序),用于管理页展示与拖拽 */
    @RequestMapping("list.do")
    @ResponseBody
    public ServerResponse list() {
        return sitePayOptionService.listForAdmin();
    }
 
    /** 拖动排序:传入新顺序的 id 列表,如 [3,1,4,2],后端按顺序将 param 设为 0,1,2,3 */
    @RequestMapping("updateSort.do")
    @ResponseBody
    public ServerResponse updateSort(@RequestBody List<Integer> orderedIds) {
        return sitePayOptionService.updateSort(orderedIds);
    }
 
    /** 开启/关闭:enabled 1=开启 0=关闭 */
    @RequestMapping("setEnabled.do")
    @ResponseBody
    public ServerResponse setEnabled(@RequestParam("id") Integer id, @RequestParam("enabled") Integer enabled) {
        return sitePayOptionService.setEnabled(id, enabled);
    }
}