-
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
20 changed files
with
629 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
server: | ||
port: 81 | ||
port: 82 | ||
|
||
|
||
# mysql | ||
spring: | ||
|
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
112 changes: 112 additions & 0 deletions
112
wine/src/main/java/com/wine/game/wine/controller/SearchController.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,112 @@ | ||
package com.wine.game.wine.controller; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.wine.game.wine.vo.SearchVo; | ||
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.SearchEntity; | ||
import com.wine.game.wine.service.SearchService; | ||
import com.zenofung.common.utils.PageUtils; | ||
import com.zenofung.common.utils.R; | ||
|
||
|
||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-04-03 20:21:42 | ||
*/ | ||
@RestController | ||
@RequestMapping("wine/search") | ||
public class SearchController { | ||
@Autowired | ||
private SearchService searchService; | ||
|
||
/** | ||
* 列表 | ||
*/ | ||
@RequestMapping("/list") | ||
//@RequiresPermissions("wine:search:list") | ||
public R list(@RequestParam Map<String, Object> params){ | ||
PageUtils page = searchService.queryPage(params); | ||
|
||
return R.ok().put("page", page); | ||
} | ||
|
||
@RequestMapping("/listKeyWord") | ||
//@RequiresPermissions("wine:search:list") | ||
public R listKeyWord(@RequestParam Map<String, Object> params){ | ||
// PageUtils page = searchService.queryPage(params); | ||
List<String> strings= searchService.getListKeyWord(); | ||
return R.ok().put("page", strings); | ||
} | ||
//获取酒馆 直接请求酒馆接口 | ||
|
||
|
||
/** | ||
* 用户搜索 | ||
*/ | ||
@RequestMapping("/listSearch") | ||
//@RequiresPermissions("wine:search:list") | ||
public R list(@RequestParam String key){ | ||
SearchVo searchVos= searchService.getListSearch(key); | ||
|
||
return R.ok().put("page", searchVos); | ||
} | ||
|
||
|
||
/** | ||
* 信息 | ||
*/ | ||
@RequestMapping("/info/{id}") | ||
//@RequiresPermissions("wine:search:info") | ||
public R info(@PathVariable("id") Integer id){ | ||
SearchEntity search = searchService.getById(id); | ||
|
||
return R.ok().put("search", search); | ||
} | ||
|
||
/** | ||
* 保存 | ||
*/ | ||
@RequestMapping("/save") | ||
//@RequiresPermissions("wine:search:save") | ||
public R save(@RequestBody SearchEntity search){ | ||
searchService.save(search); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 修改 | ||
*/ | ||
@RequestMapping("/update") | ||
//@RequiresPermissions("wine:search:update") | ||
public R update(@RequestBody SearchEntity search){ | ||
searchService.updateById(search); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 删除 | ||
*/ | ||
@RequestMapping("/delete") | ||
//@RequiresPermissions("${moduleNamez}:search:delete") | ||
public R delete(@RequestBody Integer[] ids){ | ||
searchService.removeByIds(Arrays.asList(ids)); | ||
|
||
return R.ok(); | ||
} | ||
|
||
} |
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
107 changes: 107 additions & 0 deletions
107
wine/src/main/java/com/wine/game/wine/controller/WineUsersReadyController.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,107 @@ | ||
package com.wine.game.wine.controller; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
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.WineUsersReadyEntity; | ||
import com.wine.game.wine.service.WineUsersReadyService; | ||
import com.zenofung.common.utils.PageUtils; | ||
import com.zenofung.common.utils.R; | ||
|
||
|
||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-04-03 22:10:27 | ||
*/ | ||
@RestController | ||
@RequestMapping("wine/wineusersready") | ||
public class WineUsersReadyController { | ||
@Autowired | ||
private WineUsersReadyService wineUsersReadyService; | ||
|
||
/** | ||
* 列表 | ||
*/ | ||
@RequestMapping("/list") | ||
//@RequiresPermissions("wine:wineusersready:list") | ||
public R list(@RequestParam Map<String, Object> params){ | ||
PageUtils page = wineUsersReadyService.queryPage(params); | ||
|
||
return R.ok().put("page", page); | ||
} | ||
|
||
|
||
/** | ||
* 信息 | ||
*/ | ||
@RequestMapping("/info/{id}") | ||
//@RequiresPermissions("wine:wineusersready:info") | ||
public R info(@PathVariable("id") Integer id){ | ||
WineUsersReadyEntity wineUsersReady = wineUsersReadyService.getById(id); | ||
|
||
return R.ok().put("wineUsersReady", wineUsersReady); | ||
} | ||
|
||
/** | ||
* 保存 | ||
*/ | ||
@RequestMapping("/save") | ||
//@RequiresPermissions("wine:wineusersready:save") | ||
public R save(@RequestBody WineUsersReadyEntity wineUsersReady){ | ||
List<WineUsersReadyEntity> list = wineUsersReadyService.list(new QueryWrapper<WineUsersReadyEntity>().eq("wine_id", wineUsersReady.getWineId()) | ||
.eq("user_id", wineUsersReady.getUserId())); | ||
if (list.size()<=0){ | ||
wineUsersReadyService.save(wineUsersReady); | ||
} | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 修改 | ||
*/ | ||
@RequestMapping("/update") | ||
//@RequiresPermissions("wine:wineusersready:update") | ||
public R update(@RequestBody WineUsersReadyEntity wineUsersReady){ | ||
wineUsersReadyService.updateById(wineUsersReady); | ||
|
||
return R.ok(); | ||
} | ||
|
||
@RequestMapping("/deleteByUser") | ||
//@RequiresPermissions("wine:wineusersready:update") | ||
public R deleteByUser(@RequestBody WineUsersReadyEntity wineUsersReady){ | ||
List<WineUsersReadyEntity> list = wineUsersReadyService.list(new QueryWrapper<WineUsersReadyEntity>().eq("wine_id", wineUsersReady.getWineId()) | ||
.eq("user_id", wineUsersReady.getUserId())); | ||
list.stream().forEach(m->{ | ||
wineUsersReadyService.removeById(m.getId()); | ||
}); | ||
return R.ok(); | ||
} | ||
|
||
|
||
/** | ||
* 删除 | ||
*/ | ||
@RequestMapping("/delete") | ||
//@RequiresPermissions("${moduleNamez}:wineusersready:delete") | ||
public R delete(@RequestBody Integer[] ids){ | ||
wineUsersReadyService.removeByIds(Arrays.asList(ids)); | ||
|
||
return R.ok(); | ||
} | ||
|
||
} |
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,21 @@ | ||
package com.wine.game.wine.dao; | ||
|
||
import com.wine.game.wine.entity.SearchEntity; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-04-03 20:21:42 | ||
*/ | ||
@Mapper | ||
public interface SearchDao extends BaseMapper<SearchEntity> { | ||
|
||
List<String> getListKeyWord(); | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
wine/src/main/java/com/wine/game/wine/dao/WineUsersReadyDao.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,17 @@ | ||
package com.wine.game.wine.dao; | ||
|
||
import com.wine.game.wine.entity.WineUsersReadyEntity; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-04-03 22:10:27 | ||
*/ | ||
@Mapper | ||
public interface WineUsersReadyDao extends BaseMapper<WineUsersReadyEntity> { | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
wine/src/main/java/com/wine/game/wine/entity/SearchEntity.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,48 @@ | ||
package com.wine.game.wine.entity; | ||
|
||
import com.baomidou.mybatisplus.annotation.TableId; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
import lombok.Data; | ||
|
||
/** | ||
* | ||
* | ||
* @author zenofung | ||
* @email [email protected] | ||
* @date 2022-04-03 20:21:42 | ||
*/ | ||
@Data | ||
@TableName("w_search") | ||
public class SearchEntity implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* | ||
*/ | ||
@TableId | ||
private Integer id; | ||
/** | ||
* 用户id | ||
*/ | ||
private String userId; | ||
/** | ||
* 1用户 2酒馆 3关键词 4酒局 | ||
*/ | ||
private Integer type; | ||
/** | ||
* 显示内容 | ||
*/ | ||
private String title; | ||
/** | ||
* | ||
*/ | ||
private Integer status; | ||
/** | ||
* | ||
*/ | ||
private Date createTime; | ||
|
||
} |
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 |
---|---|---|
|
@@ -47,4 +47,5 @@ public class WineUsersEntity implements Serializable { | |
@TableField(exist = false) | ||
private UserVo userVo; | ||
|
||
|
||
} |
Oops, something went wrong.