feat(): 完善修改功能

1129/donghongyang
donghongyang 2024-11-29 16:48:28 +08:00
parent 8e2b8532f9
commit 62efa5e9de
8 changed files with 91 additions and 6 deletions

View File

@ -0,0 +1,16 @@
1.
2.
3.
4. (,)
4.1
4.2
4.3
4.4
4.
4.1
4.2
1.

View File

@ -11,10 +11,7 @@ import com.muyu.common.security.service.TokenService;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -24,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
* @author muyu
*/
@RestController
public class TokenController {
@Autowired
private TokenService tokenService;

View File

@ -0,0 +1,53 @@
package com.muyu.gateway.config.properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.cors.reactive.CorsUtils;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;
/**
*
*
* @author ruoyi
*/
@Configuration
public class CorsConfig {
/**
* header
*/
private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token";
private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
private static final String ALLOWED_ORIGIN = "*";
private static final String ALLOWED_EXPOSE = "*";
private static final String MAX_AGE = "18000L";
@Bean
public WebFilter corsFilter() {
return (ServerWebExchange ctx, WebFilterChain chain) -> {
ServerHttpRequest request = ctx.getRequest();
if (CorsUtils.isCorsRequest(request)) {
ServerHttpResponse response = ctx.getResponse();
HttpHeaders headers = response.getHeaders();
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
headers.add("Access-Control-Max-Age", MAX_AGE);
headers.add("Access-Control-Allow-Credentials", "true");
if (request.getMethod() == HttpMethod.OPTIONS) {
response.setStatusCode(HttpStatus.OK);
return Mono.empty();
}
}
return chain.filter(ctx);
};
}
}

View File

@ -3,6 +3,7 @@ package com.muyu.marketing.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoModel;
@ -10,6 +11,7 @@ import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@ -54,6 +56,8 @@ public class ActivityTeamInfo extends BaseEntity {
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
*

View File

@ -3,9 +3,11 @@ package com.muyu.marketing.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -41,6 +43,8 @@ public class ActivityTeamOpenInfo extends BaseEntity {
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* ID

View File

@ -10,6 +10,11 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
/**
*
*/
@Data
@SuperBuilder
@AllArgsConstructor

View File

@ -8,6 +8,10 @@ import lombok.experimental.SuperBuilder;
import java.util.List;
/**
*
*/
@Data
@SuperBuilder
@AllArgsConstructor

View File

@ -109,11 +109,12 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
*/
@Override
public void bateUpdate(ActivityTeamInfoModel activityTeamInfoModel) {
//根据 Sku的Id删除
activityTeamOpenInfoService.removeBatchByIds(activityTeamInfoModel.getActivityTeamProductUpdModel().getIds());
//添加
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoModel.getActivityTeamProductUpdModel().getActivityTeamProductSkuAddModelList();
//根据 Sku的Id删除
activityTeamOpenInfoService.removeBatchByIds(activityTeamInfoModel.getActivityTeamProductUpdModel().getIds());
teamProductSkuAddModelList.forEach(
activityTeamProductSkuAddModel -> {
activityTeamProductSkuAddModel.setTeamId(activityTeamInfoModel.getId());