-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
898 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
mall-common/src/main/java/com/zenofung/common/utils/ImageUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.zenofung.common.utils; | ||
|
||
import cn.hutool.core.io.FileUtil; | ||
import cn.hutool.core.util.IdUtil; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* @description: | ||
* | ||
* @author: zeno fung | ||
* | ||
* @create: 2022-03-09 14:14 | ||
*/ | ||
public class ImageUtil { | ||
|
||
public static String writeImage(byte[] imageBytes,String fileName,String targetPath,String imageUrl){ | ||
String fileSuffix = fileName.substring(fileName.lastIndexOf('.')); | ||
if(!fileSuffix.equals(".jpg") && !fileSuffix.equals(".jpeg") && !fileSuffix.equals(".png") && !fileSuffix.equals(".gif")&& !fileSuffix.equals(".mp4")){ | ||
throw new RuntimeException("请上传图片或视频"); | ||
} | ||
String s = IdUtil.fastUUID(); | ||
FileUtil.writeBytes(imageBytes, targetPath+s+fileSuffix); | ||
return imageUrl+s+fileSuffix; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
wine/src/main/java/com/wine/game/wine/ServletInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.wine.game.wine; | ||
|
||
import org.springframework.boot.builder.SpringApplicationBuilder; | ||
import org.springframework.boot.web.servlet.ServletComponentScan; | ||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
|
||
|
||
public class ServletInitializer extends SpringBootServletInitializer { | ||
|
||
@Override | ||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { | ||
this.setRegisterErrorPageFilter(false); | ||
return application.sources(WineApplication.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
wine/src/main/java/com/wine/game/wine/controller/ArticlePraiseController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package com.wine.game.wine.controller; | ||
|
||
import java.util.Arrays; | ||
import java.util.Map; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.wine.game.wine.entity.ArticlePraiseEntity; | ||
import com.wine.game.wine.service.ArticlePraiseService; | ||
import com.zenofung.common.utils.PageUtils; | ||
import com.zenofung.common.utils.R; | ||
|
||
|
||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-03-09 17:35:50 | ||
*/ | ||
@RestController | ||
@RequestMapping("wine/articlepraise") | ||
public class ArticlePraiseController { | ||
@Autowired | ||
private ArticlePraiseService articlePraiseService; | ||
|
||
/** | ||
* 列表 | ||
*/ | ||
@RequestMapping("/list") | ||
//@RequiresPermissions("wine:articlepraise:list") | ||
public R list(@RequestParam Map<String, Object> params){ | ||
PageUtils page = articlePraiseService.queryPage(params); | ||
|
||
return R.ok().put("page", page); | ||
} | ||
|
||
|
||
/** | ||
* 信息 | ||
*/ | ||
@RequestMapping("/info/{id}") | ||
//@RequiresPermissions("wine:articlepraise:info") | ||
public R info(@PathVariable("id") Integer id){ | ||
ArticlePraiseEntity articlePraise = articlePraiseService.getById(id); | ||
|
||
return R.ok().put("articlePraise", articlePraise); | ||
} | ||
|
||
/** | ||
* 保存 | ||
*/ | ||
@RequestMapping("/save") | ||
//@RequiresPermissions("wine:articlepraise:save") | ||
public R save(@RequestBody ArticlePraiseEntity articlePraise){ | ||
articlePraiseService.save(articlePraise); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 修改 | ||
*/ | ||
@RequestMapping("/update") | ||
//@RequiresPermissions("wine:articlepraise:update") | ||
public R update(@RequestBody ArticlePraiseEntity articlePraise){ | ||
articlePraiseService.updateById(articlePraise); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 删除 | ||
*/ | ||
@RequestMapping("/delete") | ||
//@RequiresPermissions("${moduleNamez}:articlepraise:delete") | ||
public R delete(@RequestBody ArticlePraiseEntity articlePraiseEntity){ | ||
articlePraiseService.removeByUserId(articlePraiseEntity); | ||
|
||
return R.ok(); | ||
} | ||
|
||
|
||
|
||
} |
91 changes: 91 additions & 0 deletions
91
wine/src/main/java/com/wine/game/wine/controller/ComComPraiseController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package com.wine.game.wine.controller; | ||
|
||
import java.util.Arrays; | ||
import java.util.Map; | ||
|
||
import com.wine.game.wine.entity.ComComEntity; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.wine.game.wine.entity.ComComPraiseEntity; | ||
import com.wine.game.wine.service.ComComPraiseService; | ||
import com.zenofung.common.utils.PageUtils; | ||
import com.zenofung.common.utils.R; | ||
|
||
|
||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-03-09 17:35:50 | ||
*/ | ||
@RestController | ||
@RequestMapping("wine/comcompraise") | ||
public class ComComPraiseController { | ||
@Autowired | ||
private ComComPraiseService comComPraiseService; | ||
|
||
/** | ||
* 列表 | ||
*/ | ||
@RequestMapping("/list") | ||
//@RequiresPermissions("wine:comcompraise:list") | ||
public R list(@RequestParam Map<String, Object> params){ | ||
PageUtils page = comComPraiseService.queryPage(params); | ||
|
||
return R.ok().put("page", page); | ||
} | ||
|
||
|
||
/** | ||
* 信息 | ||
*/ | ||
@RequestMapping("/info/{id}") | ||
//@RequiresPermissions("wine:comcompraise:info") | ||
public R info(@PathVariable("id") Integer id){ | ||
ComComPraiseEntity comComPraise = comComPraiseService.getById(id); | ||
|
||
return R.ok().put("comComPraise", comComPraise); | ||
} | ||
|
||
/** | ||
* 保存 | ||
*/ | ||
@RequestMapping("/save") | ||
//@RequiresPermissions("wine:comcompraise:save") | ||
public R save(@RequestBody ComComPraiseEntity comComPraise){ | ||
comComPraiseService.save(comComPraise); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 修改 | ||
*/ | ||
@RequestMapping("/update") | ||
//@RequiresPermissions("wine:comcompraise:update") | ||
public R update(@RequestBody ComComPraiseEntity comComPraise){ | ||
comComPraiseService.updateById(comComPraise); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 删除 | ||
*/ | ||
@RequestMapping("/delete") | ||
//@RequiresPermissions("${moduleNamez}:comcompraise:delete") | ||
public R delete(@RequestBody ComComPraiseEntity comComPraiseEntity){ | ||
comComPraiseService.removeByUserId(comComPraiseEntity); | ||
return R.ok(); | ||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.