首页 > 编程语言 >2024年6月最新版波猫商店自动售卡系统源码

2024年6月最新版波猫商店自动售卡系统源码

时间:2024-06-22 23:30:56浏览次数:3  
标签:JsonResult return RequestMapping 售卡 value theme 源码 import 最新版

内容目录


一、详细介绍

最新版波猫商店自动售卡系统源码

适用于各种电商、优惠卷、论坛邀请码、充值卡、激活码、注册码、腾讯爱奇艺积分CDK等,支持手动和全自动发货,还有类似1688的分层批发模式。

功能特色:

开发语言:JAVA 开发框架:Spring boot 前端UI layui

layui 开发的白天 - 黑夜 - 炫丽暗黑模板

基于Layui开发的炫丽后台界面

集成了后台多种主题模式

炫丽暗黑界面支持自定义背景图片

炫丽的前台卡片式商品展示

支持无限层级的批发模式

集成了微信订单消息通知以及邮件系统

支持自定义网站标题、关键字、logo、等

支持移动端支付宝唤醒APP支付

集成了大量支付接口【微信官方扫码、支付宝当面付、v免签、payjs、虎皮椒V3、YunGouOS、值联码支付、码支付、USDT、等…】

支持首页公告弹窗展示

集成了强大的优惠券系统

集成了自定义的商品购买备注字段

二、效果展示

1.部分代码

代码如下(示例):

package cn.zlianpay.theme.controller;
 
import cn.zlianpay.common.core.annotation.OperLog;
import cn.zlianpay.common.core.web.*;
import cn.zlianpay.settings.entity.ShopSettings;
import cn.zlianpay.settings.service.ShopSettingsService;
import cn.zlianpay.theme.entity.Theme;
import cn.zlianpay.theme.service.ThemeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
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.ResponseBody;
 
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
 
/**
 * 主题配置管理
 * Created by Panyoujie on 2021-06-28 00:36:29
 */
@Controller
@RequestMapping("/theme/theme")
public class ThemeController extends BaseController {
    @Autowired
    private ThemeService themeService;
 
    @Autowired
    private ShopSettingsService shopSettingsService;
 
    @RequiresPermissions("theme:theme:view")
    @RequestMapping()
    public String view() {
        return "theme/theme.html";
    }
 
    /**
     * 分页查询主题配置
     */
    @RequiresPermissions("theme:theme:list")
    @OperLog(value = "主题配置管理", desc = "分页查询")
    @ResponseBody
    @RequestMapping("/page")
    public PageResult<Theme> page(HttpServletRequest request) {
        PageParam<Theme> pageParam = new PageParam<>(request);
        return new PageResult<>(themeService.page(pageParam, pageParam.getWrapper()).getRecords(), pageParam.getTotal());
    }
 
    /**
     * 查询全部主题配置
     */
    @RequiresPermissions("theme:theme:list")
    @OperLog(value = "主题配置管理", desc = "查询全部")
    @ResponseBody
    @RequestMapping("/list")
    public JsonResult list(HttpServletRequest request) {
        PageParam<Theme> pageParam = new PageParam<>(request);
        return JsonResult.ok().setData(themeService.list(pageParam.getOrderWrapper()));
    }
 
    /**
     * 根据id查询主题配置
     */
    @RequiresPermissions("theme:theme:list")
    @OperLog(value = "主题配置管理", desc = "根据id查询")
    @ResponseBody
    @RequestMapping("/get")
    public JsonResult get(Integer id) {
        return JsonResult.ok().setData(themeService.getById(id));
    }
 
    /**
     * 添加主题配置
     */
    @RequiresPermissions("theme:theme:save")
    @OperLog(value = "主题配置管理", desc = "添加", param = false, result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/save")
    public JsonResult save(Theme theme) {
        if (themeService.save(theme)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
 
    /**
     * 修改主题配置
     */
    @RequiresPermissions("theme:theme:update")
    @OperLog(value = "主题配置管理", desc = "修改", param = false, result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/update")
    public JsonResult update(Theme theme) {
        if (themeService.updateById(theme)) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }
 
    /**
     * 删除主题配置
     */
    @RequiresPermissions("theme:theme:remove")
    @OperLog(value = "主题配置管理", desc = "删除", result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/remove")
    public JsonResult remove(Integer id) {
        if (themeService.removeById(id)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
 
    /**
     * 批量添加主题配置
     */
    @RequiresPermissions("theme:theme:save")
    @OperLog(value = "主题配置管理", desc = "批量添加", param = false, result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/saveBatch")
    public JsonResult saveBatch(@RequestBody List<Theme> list) {
        if (themeService.saveBatch(list)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
 
    /**
     * 批量修改主题配置
     */
    @RequiresPermissions("theme:theme:update")
    @OperLog(value = "主题配置管理", desc = "批量修改", result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/updateBatch")
    public JsonResult updateBatch(@RequestBody BatchParam<Theme> batchParam) {
        if (batchParam.update(themeService, "id")) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }
 
    /**
     * 批量删除主题配置
     */
    @RequiresPermissions("theme:theme:remove")
    @OperLog(value = "主题配置管理", desc = "批量删除", result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/removeBatch")
    public JsonResult removeBatch(@RequestBody List<Integer> ids) {
        if (themeService.removeByIds(ids)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
 
    /**
     * 修改状态
     */
    @RequiresPermissions("theme:theme:update")
    @OperLog(value = "主题配置管理", desc = "修改状态", result = true)
    @CacheEvict(value = "theme", allEntries = true)
    @ResponseBody
    @RequestMapping("/status/update")
    public JsonResult updateStates(Integer id, Integer enabled) {
        ShopSettings shopSettings = shopSettingsService.getById(1);
        if (shopSettings.getAuthorizeStatus() == 0) {
            return JsonResult.error("您的系统当前为副版、部分功能不能使用。");
        }
 
        if (enabled == null || (enabled != 0 && enabled != 1)) {
            return JsonResult.error("状态值不正确");
        }
 
        List<Theme> list = themeService.list();
        List<Theme> themeList = list.stream().map((theme) -> {
            theme.setEnable(0);
            return theme;
        }).collect(Collectors.toList());
        themeService.updateBatchById(themeList);
 
        Theme theme = new Theme();
        theme.setId(id);
        theme.setEnable(enabled);
        if (themeService.updateById(theme)) {
            return JsonResult.ok("主题切换成功!");
        }
        return JsonResult.error("主题切换失败!");
    }
 
    @ResponseBody
    @RequestMapping("/switchMode")
    public JsonResult switchMode(HttpServletResponse response, String dark_mode) {
        Cookie cookie = new Cookie("darkmode", dark_mode);
        cookie.setPath("/");
        cookie.setMaxAge(24 * 60 * 60 * 30); // 30天过期
        // 将cookie对象加入response响应
        response.addCookie(cookie);
        return JsonResult.ok(dark_mode);
    }
 
}

2.效果图展示

请添加图片描述


三、学习资料下载

蓝奏云:https://qumaw.lanzoul.com/iDz3u22csz7c

标签:JsonResult,return,RequestMapping,售卡,value,theme,源码,import,最新版
From: https://blog.csdn.net/2401_85149468/article/details/139862535

相关文章