Compare commits

..

No commits in common. "1e8197f01ad9eb23890a9229d150622b5f137880" and "5cc7874b77ba3e57e3ec45d4b0eac3e9bb84d58f" have entirely different histories.

12 changed files with 204 additions and 133 deletions

View File

@ -67,12 +67,6 @@
<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>

View File

@ -1,12 +1,16 @@
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;
@ -18,7 +22,6 @@ import java.util.List;
* @Description
* @Date2024/12/31 10:48
*/
@RestController
@RequestMapping("/MallProduct")
public class MallProductController extends BaseController {
@ -31,56 +34,6 @@ 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();
}
}

View File

@ -121,6 +121,7 @@ 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

View File

@ -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;
/** 搜索值 */
@TableField(exist = false)
@JsonIgnore
@TableField(exist = false)
private String searchValue;
/** 创建者 */

View File

@ -0,0 +1,144 @@
///*
// * 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("\\", "/");
//// }
//
//}

View File

@ -0,0 +1,43 @@
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());
}
}

View File

@ -35,7 +35,8 @@ public class UserMember extends BaseEntity {
// 会员积分
private Integer points;
// 订阅状态 active活跃连续包月、inactive非活跃不连续包月、pending待支付和expired过期
// 订阅状态 active活跃、inactive非活跃、pending待支付和expired过期
@EnumValue
private MemberMenu subscriptionStatus;
// 支付方式

View File

@ -24,6 +24,7 @@ import java.math.BigDecimal;
public class MallProduct extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ -53,11 +54,6 @@ public class MallProduct extends BaseEntity {
*
*/
private BigDecimal amount;
/**
* (0 1 2 3)
*/
private String status;
/**
*
*/

View File

@ -3,7 +3,6 @@ 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;
/**
* @AuthorChenYan
@ -15,6 +14,4 @@ import org.apache.ibatis.annotations.Param;
*/
@Mapper
public interface MallProductMapper extends BaseMapper<MallProduct> {
String selectMallProductById(@Param("mallProductId") Long mallProductId);
}

View File

@ -1,7 +1,6 @@
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;
@ -17,16 +16,8 @@ import java.util.List;
*/
public interface MallProductService extends IService<MallProduct> {
List<MallProduct> selectMallProductList(MallProduct sysJob);
String selectMallProductById(Long mallProductId);
List<MallProduct> selectMallProductRuleInfoList(MallProduct mallProductRuleInfo);
int insertMallProduct(MallProduct mallProduct);
int updateMallProduct(MallProduct mallProduct);
void deleteMallProductByIds(IdsParam ids);
}

View File

@ -2,7 +2,6 @@ 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;
@ -29,34 +28,14 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallPr
@Autowired
private MallProductMapper postMapper;
@Override
public List<MallProduct> selectMallProductList(MallProduct mallProduct) {
public List<MallProduct> selectMallProductRuleInfoList(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());
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());
MallProduct mallProducts = postMapper.selectOne(queryWrapper);
return (List<MallProduct>) mallProducts;
}

View File

@ -1,28 +0,0 @@
<?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>