Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 0821 #188

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Java CI with Maven

on:
push:
branches:
branches:
- master
- dev
pull_request:
Expand All @@ -25,7 +25,7 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn install -DskipTests
run: mvn install
- name: Codecov
uses: codecov/codecov-action@v3

34 changes: 1 addition & 33 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ goodsKill
| |--goodskill-generator ||项目代码生成
| |--goodskill-service ||服务API接口实现
|--goodskill-spring-boot-starter ||项目配置自动装配
|--goodskill-web ||提供页面客户端访问,controller层在这一模块
|--goodskill-web ||提供秒杀模拟接口访问
|--goodskill-job ||elastic-job定时任务
|--goodskill-seata ||集成nacos+dubbo+shardingjdbc+seata的分布式事务解决方案示例
|--goodskill-oauth2 ||oauth2.0自定义模块
Expand Down Expand Up @@ -257,7 +257,6 @@ ____

== ✔️项目已知问题
* oauth2模块升级后兼容性尚未测试
* 单元测试待重新验证,目前为跳过单元测试状态
* web服务移除shiro后的鉴权问题

== ❓常见问题
Expand Down Expand Up @@ -319,39 +318,8 @@ hub.docker被墙,国内可使用阿里云镜像加速器,具体操作见 htt
* `http://www.goodskill.com/goodskill/es/**` 对应访问``goodskill-es-provider``服务
* `http://www.goodskill.com/goodskill/seata/**` 对应访问``goodskill-seata``服务
* `http://www.goodskill.com/goodskill/common/**` 对应访问``goodskill-service-provider``服务
____

动态路由配置说明
____
* 网关支持动态加载路由配置,修改后实时生效,使用时需要在nacos配置中心添加配置文件,文件名可通过``application.yml``中的``nacos.router.data.id``配置进行修改(默认nacos dataId为``goodskill-gateway-routes``),例如:

+
.路由配置文件内容为json数组格式
====
[source,json]
[
{
"id": "goodskill-service-provider",
"predicates": [
{
"name": "Path",
"args": {
"_genkey_0": "/goodskill/common/**"
}
}
],
"filters": [
{
"name": "StripPrefix",
"args": {
"_genkey_1": "2"
}
}
],
"uri": "lb://goodskill-service-provider"
}
]
====

=== API接口说明

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.goodskill.oauth2.authserver;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -13,6 +14,7 @@

@SpringBootTest
@AutoConfigureMockMvc
@Disabled
public class OAuth2AuthorizationServerApplicationTests {

@Autowired
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 6 additions & 1 deletion goodskill-spring-boot-provider/goodskill-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<!-- <scope>test</scope>-->
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -253,4 +258,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.goodskill.web.constant;
package com.goodskill.service.common;

/**
* 服务器响应码定义
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.goodskill.service.controller;

import com.goodskill.api.service.GoodsService;
import com.goodskill.entity.Goods;
import com.goodskill.service.util.HttpUrlUtil;
import com.goodskill.service.util.UploadFileUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
* Created by heng on 17/1/18.
*/
@Tag(name = "商品管理")
@Controller
@RequestMapping("/seckill/goods")
public class GoodsController {
@Resource
private GoodsService goodsService;
@Resource
private UploadFileUtil uploadFileUtil;

@GetMapping("/new")
public String addGoodsPage(){
return "addGoods";
}

@Transactional
@RequestMapping(value = "/create",method = RequestMethod.POST)
public String add(Goods goods, @RequestParam("file") MultipartFile file){
goods.setCreateTime(new Date());
String url = uploadFileUtil.uploadFile(file);
goods.setPhotoUrl(url);
goodsService.addGoods(goods);
return HttpUrlUtil.replaceRedirectUrl("redirect:/seckill/list");
}

@RequestMapping(value = "/list",method = RequestMethod.GET,produces = {
"application/json;charset=UTF-8"})
@ResponseBody
public List<Goods> list(){
return goodsService.list();
}

@RequestMapping(value = "/{goodsId}", method = RequestMethod.GET, produces = {
"application/json;charset=UTF-8"})
@ResponseBody
public Goods getGoodsById(@PathVariable(value = "goodsId") long goodsId) {
return goodsService.getById(goodsId);
}
}
Loading