Compare commits
12 Commits
5cc7874b77
...
1e8197f01a
Author | SHA1 | Date |
---|---|---|
|
1e8197f01a | |
|
1b32f289cb | |
|
7215fcb48e | |
|
51055443c5 | |
|
1a1803b991 | |
|
1f05411e72 | |
|
76a23fa933 | |
|
5f5cc9aa7e | |
|
49e8e7f231 | |
|
e35045b1c8 | |
|
12b00c70ed | |
|
04f0d884f0 |
|
@ -67,6 +67,12 @@
|
|||
<artifactId>mcwl-myInvitation</artifactId>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<!-- 公共模块-->
|
||||
<dependency>
|
||||
<groupId>com.mcwl</groupId>
|
||||
<artifactId>mcwl-common</artifactId>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<!-- 资源中心模块-->
|
||||
<dependency>
|
||||
<groupId>com.mcwl</groupId>
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
|
||||
|
||||
import com.mcwl.common.annotation.Anonymous;
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
|
||||
|
||||
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.resource.domain.MallProduct;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
@ -22,6 +18,7 @@ import java.util.List;
|
|||
* @Description 商品
|
||||
* @Date:2024/12/31 10:48
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/MallProduct")
|
||||
public class MallProductController extends BaseController {
|
||||
|
@ -34,6 +31,56 @@ public class MallProductController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MallProduct sysJob)
|
||||
{
|
||||
startPage();
|
||||
List<MallProduct> list = mallProductRuleInfoService.selectMallProductList(sysJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{jobId}")
|
||||
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
||||
{
|
||||
return success(mallProductRuleInfoService.selectMallProductById(jobId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody MallProduct mallProduct)
|
||||
{
|
||||
mallProduct.setCreateBy(getUsername());
|
||||
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping("/upda")
|
||||
public AjaxResult edit(@RequestBody MallProduct mallProduct)
|
||||
{
|
||||
mallProduct.setUpdateBy(getUsername());
|
||||
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除定
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult remove(@RequestBody IdsParam ids)
|
||||
{
|
||||
mallProductRuleInfoService.deleteMallProductByIds(ids);
|
||||
return success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -121,7 +121,6 @@ mybatis-plus:
|
|||
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
# 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
logImpl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
# 枚举处理器
|
||||
default-enum-type-handler: com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler
|
||||
global-config:
|
||||
# 是否打印 Logo banner
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
public class BaseEntity implements Serializable
|
||||
|
@ -21,8 +21,8 @@ public class BaseEntity implements Serializable
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 搜索值 */
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
@JsonIgnore
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
///*
|
||||
// * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
||||
// *
|
||||
// * https://www.mall4j.com/
|
||||
// *
|
||||
// * 未经允许,不可做商业用途!
|
||||
// *
|
||||
// * 版权所有,侵权必究!
|
||||
// */
|
||||
//package com.mcwl.common.i18n;
|
||||
//
|
||||
//
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.context.i18n.LocaleContextHolder;
|
||||
//import org.springframework.context.support.MessageSourceAccessor;
|
||||
//import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//import java.util.Locale;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
///**
|
||||
// * 多语言国际化消息工具类
|
||||
// * @author mcwl
|
||||
// */
|
||||
//@Slf4j
|
||||
//public class I18nMessage {
|
||||
// private static MessageSourceAccessor accessor;
|
||||
//
|
||||
//// private static final String BASE_FOLDE = "i18n";
|
||||
//
|
||||
// private static final String BASE_NAME = "i18n/messages";
|
||||
//
|
||||
// static{
|
||||
// ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource = new ReloadableResourceBundleMessageSource();
|
||||
// reloadableResourceBundleMessageSource.setBasenames(BASE_NAME);
|
||||
// reloadableResourceBundleMessageSource.setCacheSeconds(5);
|
||||
// reloadableResourceBundleMessageSource.setDefaultEncoding("UTF-8");
|
||||
// accessor = new MessageSourceAccessor(reloadableResourceBundleMessageSource);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//// /**
|
||||
//// * 获取一条语言配置信息
|
||||
//// *
|
||||
//// * @param message 配置信息属性名,eg: api.response.code.user.signUp
|
||||
//// * @return
|
||||
//// */
|
||||
//// public static String getMessage(String message) {
|
||||
//// Locale locale = LocaleContextHolder.getLocale();
|
||||
//// return I18nMessage.accessor.getMessage(message,locale);
|
||||
//// }
|
||||
//
|
||||
// /**
|
||||
// * 获取一条语言配置信息
|
||||
// *
|
||||
// * @param message 配置信息属性名,eg: api.response.code.user.signUp
|
||||
// * @return
|
||||
// */
|
||||
// public static String getMessage(String message) {
|
||||
// Locale locale = LocaleContextHolder.getLocale();
|
||||
// try {
|
||||
// return accessor.getMessage(message,locale);
|
||||
// }catch (Exception e){
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// /**
|
||||
// * 获取一条语言配置信息(后台管理)
|
||||
// *
|
||||
// * @return
|
||||
// * @throws IOException
|
||||
// */
|
||||
// public static Integer getLang() {
|
||||
// Locale locale = LocaleContextHolder.getLocale();
|
||||
// return LanguageEnum.valueOf(locale).getLang();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取一条语言配置信息(小程序、pc)
|
||||
// *
|
||||
// * @return
|
||||
// * @throws IOException
|
||||
// */
|
||||
// public static Integer getDbLang() {
|
||||
// Integer lang = getLang();
|
||||
// if (Objects.equals(lang, 0)) {
|
||||
// return LanguageEnum.LANGUAGE_ZH_CN.getLang();
|
||||
// }
|
||||
// return lang;
|
||||
// }
|
||||
//
|
||||
//// /**
|
||||
//// * 获取文件夹下所有的国际化文件名
|
||||
//// *
|
||||
//// * @param folderName 文件名
|
||||
//// * @return
|
||||
//// * @throws IOException
|
||||
//// */
|
||||
//// private static String[] getAllBaseNames(final String folderName) throws IOException {
|
||||
//// URL url = Thread.currentThread().getContextClassLoader()
|
||||
//// .getResource(folderName);
|
||||
//// if (null == url) {
|
||||
//// throw new RuntimeException("无法获取资源文件路径");
|
||||
//// }
|
||||
////
|
||||
//// List<String> baseNames = new ArrayList<>();
|
||||
//// if (url.getProtocol().equalsIgnoreCase("file")) {
|
||||
//// // 文件夹形式,用File获取资源路径
|
||||
//// File file = new File(url.getFile());
|
||||
//// if (file.exists() && file.isDirectory()) {
|
||||
//// baseNames = Files.walk(file.toPath())
|
||||
//// .filter(path -> path.toFile().isFile())
|
||||
//// .map(Path::toString)
|
||||
//// .map(path -> path.substring(path.indexOf(folderName)))
|
||||
//// .map(I18nMessage::getI18FileName)
|
||||
//// .distinct()
|
||||
//// .collect(Collectors.toList());
|
||||
//// } else {
|
||||
//// log.error("指定的baseFile不存在或者不是文件夹");
|
||||
//// }
|
||||
//// }
|
||||
//// return baseNames.toArray(new String[0]);
|
||||
//// }
|
||||
////
|
||||
//// /**
|
||||
//// * 把普通文件名转换成国际化文件名
|
||||
//// *
|
||||
//// * @param filename
|
||||
//// * @return
|
||||
//// */
|
||||
//// private static String getI18FileName(String filename) {
|
||||
//// filename = filename.replace(".properties", "");
|
||||
////// for (int i = 0; i < 2; i++) {
|
||||
////// int index = filename.lastIndexOf("_");
|
||||
////// if (index != -1) {
|
||||
////// filename = filename.substring(0, index);
|
||||
////// }
|
||||
////// }
|
||||
//// return filename.replace("\\", "/");
|
||||
//// }
|
||||
//
|
||||
//}
|
|
@ -1,43 +0,0 @@
|
|||
package com.mcwl.framework.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.LocaleResolver;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
||||
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
||||
import com.mcwl.common.constant.Constants;
|
||||
|
||||
/**
|
||||
* 资源文件配置加载
|
||||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@Configuration
|
||||
public class I18nConfig implements WebMvcConfigurer
|
||||
{
|
||||
@Bean
|
||||
public LocaleResolver localeResolver()
|
||||
{
|
||||
SessionLocaleResolver slr = new SessionLocaleResolver();
|
||||
// 默认语言
|
||||
slr.setDefaultLocale(Constants.DEFAULT_LOCALE);
|
||||
return slr;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LocaleChangeInterceptor localeChangeInterceptor()
|
||||
{
|
||||
LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
|
||||
// 参数名
|
||||
lci.setParamName("lang");
|
||||
return lci;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry)
|
||||
{
|
||||
registry.addInterceptor(localeChangeInterceptor());
|
||||
}
|
||||
}
|
|
@ -35,8 +35,7 @@ public class UserMember extends BaseEntity {
|
|||
// 会员积分
|
||||
private Integer points;
|
||||
|
||||
// 订阅状态 active(活跃)、inactive(非活跃)、pending(待支付)和expired(过期)
|
||||
@EnumValue
|
||||
// 订阅状态 active(活跃,连续包月)、inactive(非活跃,不连续包月)、pending(待支付)和expired(过期)
|
||||
private MemberMenu subscriptionStatus;
|
||||
|
||||
// 支付方式
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.math.BigDecimal;
|
|||
public class MallProduct extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
|
@ -54,6 +53,11 @@ public class MallProduct extends BaseEntity {
|
|||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 状态(0未审核 1公开 2隐私 3未通过)
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 图片名称
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.resource.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.MallProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
|
@ -14,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface MallProductMapper extends BaseMapper<MallProduct> {
|
||||
String selectMallProductById(@Param("mallProductId") Long mallProductId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.resource.domain.MallProduct;
|
||||
import kotlin.Result;
|
||||
|
||||
|
@ -16,8 +17,16 @@ import java.util.List;
|
|||
*/
|
||||
public interface MallProductService extends IService<MallProduct> {
|
||||
|
||||
List<MallProduct> selectMallProductList(MallProduct sysJob);
|
||||
|
||||
List<MallProduct> selectMallProductRuleInfoList(MallProduct mallProductRuleInfo);
|
||||
String selectMallProductById(Long mallProductId);
|
||||
|
||||
|
||||
int insertMallProduct(MallProduct mallProduct);
|
||||
|
||||
int updateMallProduct(MallProduct mallProduct);
|
||||
|
||||
|
||||
void deleteMallProductByIds(IdsParam ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.mcwl.resource.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.resource.domain.MallProduct;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
|
@ -28,14 +29,34 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallPr
|
|||
@Autowired
|
||||
private MallProductMapper postMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<MallProduct> selectMallProductRuleInfoList(MallProduct mallProduct) {
|
||||
public List<MallProduct> selectMallProductList(MallProduct mallProduct) {
|
||||
QueryWrapper<MallProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(MallProduct::getProductName, mallProduct.getProductName());
|
||||
queryWrapper.lambda().eq(MallProduct::getName, mallProduct.getName());
|
||||
queryWrapper.lambda().eq(MallProduct::getAmount, mallProduct.getAmount());
|
||||
MallProduct mallProducts = postMapper.selectOne(queryWrapper);
|
||||
return (List<MallProduct>) mallProducts;
|
||||
return postMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectMallProductById(Long mallProductId) {
|
||||
return postMapper.selectMallProductById(mallProductId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertMallProduct(MallProduct mallProduct) {
|
||||
return postMapper.insert(mallProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMallProduct(MallProduct mallProduct) {
|
||||
return postMapper.updateById(mallProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMallProductByIds(IdsParam ids) {
|
||||
postMapper.deleteBatchIds(ids.getIds());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
|
||||
|
||||
|
||||
<select id="selectMallProductById" resultType="java.lang.String">
|
||||
select id,
|
||||
user_id,
|
||||
product_id,
|
||||
product_name,
|
||||
detail,
|
||||
model,
|
||||
amount,
|
||||
name,
|
||||
status,
|
||||
zip_url,
|
||||
url,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
del_flag
|
||||
from mall_product where product_id =#{mallProductId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue