parent
519fe0f14b
commit
1827c5ff8c
@ -0,0 +1,26 @@
|
||||
package com.example.recommend.controller;
|
||||
|
||||
import com.example.recommend.common.CommonRes;
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
import com.example.recommend.service.CategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller("/category")
|
||||
@RequestMapping("/category")
|
||||
public class CategoryController {
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/list")
|
||||
public CommonRes list() {
|
||||
List<CategoryModel> categoryModelList = categoryService.selectAll();
|
||||
return CommonRes.create(categoryModelList);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.example.recommend.controller.admin;
|
||||
|
||||
import com.example.recommend.common.AdminPermission;
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.common.CommonUtil;
|
||||
import com.example.recommend.common.EmBusinessError;
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
import com.example.recommend.request.CategoryCreateReq;
|
||||
import com.example.recommend.request.PageQuery;
|
||||
import com.example.recommend.service.CategoryService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller("/admin/category")
|
||||
@RequestMapping("/admin/category")
|
||||
public class CategoryController {
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
//品类列表
|
||||
@RequestMapping("/index")
|
||||
@AdminPermission
|
||||
public ModelAndView index(PageQuery pageQuery) {
|
||||
PageHelper.startPage(pageQuery.getPage(), pageQuery.getSize());
|
||||
List<CategoryModel> categoryModelList = categoryService.selectAll();
|
||||
PageInfo<CategoryModel> categoryModelPageInfo = new PageInfo<>(categoryModelList);
|
||||
ModelAndView modelAndView = new ModelAndView("/admin/category/index.html");
|
||||
modelAndView.addObject("data", categoryModelPageInfo);
|
||||
modelAndView.addObject("CONTROLLER_NAME", "category");
|
||||
modelAndView.addObject("ACTION_NAME", "index");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping("/createpage")
|
||||
@AdminPermission
|
||||
public ModelAndView createPage() {
|
||||
ModelAndView modelAndView = new ModelAndView("/admin/category/create.html");
|
||||
modelAndView.addObject("CONTROLLER_NAME", "category");
|
||||
modelAndView.addObject("ACTION_NAME", "create");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@AdminPermission
|
||||
public String create(@Valid CategoryCreateReq categoryCreateReq, BindingResult bindingResult) throws BusinessException {
|
||||
if (bindingResult.hasErrors()) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, CommonUtil.processErrorString(bindingResult));
|
||||
}
|
||||
|
||||
CategoryModel categoryModel = new CategoryModel();
|
||||
categoryModel.setName(categoryCreateReq.getName());
|
||||
categoryModel.setIconUrl(categoryCreateReq.getIconUrl());
|
||||
categoryModel.setSort(categoryCreateReq.getSort());
|
||||
|
||||
categoryService.create(categoryModel);
|
||||
|
||||
return "redirect:/admin/category/index";
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.example.recommend.controller.admin;
|
||||
|
||||
import com.example.recommend.common.AdminPermission;
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.common.CommonUtil;
|
||||
import com.example.recommend.common.EmBusinessError;
|
||||
import com.example.recommend.model.ShopModel;
|
||||
import com.example.recommend.request.PageQuery;
|
||||
import com.example.recommend.request.ShopCreateReq;
|
||||
import com.example.recommend.service.ShopService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller("/admin/shop")
|
||||
@RequestMapping("/admin/shop")
|
||||
public class ShopController {
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
//门店列表
|
||||
@RequestMapping("/index")
|
||||
@AdminPermission
|
||||
public ModelAndView index(PageQuery pageQuery) {
|
||||
PageHelper.startPage(pageQuery.getPage(), pageQuery.getSize());
|
||||
List<ShopModel> shopModelList = shopService.selectAll();
|
||||
PageInfo<ShopModel> shopModelPageInfo = new PageInfo<>(shopModelList);
|
||||
ModelAndView modelAndView = new ModelAndView("/admin/shop/index.html");
|
||||
modelAndView.addObject("data", shopModelPageInfo);
|
||||
modelAndView.addObject("CONTROLLER_NAME", "shop");
|
||||
modelAndView.addObject("ACTION_NAME", "index");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping("/createpage")
|
||||
@AdminPermission
|
||||
public ModelAndView createPage() {
|
||||
ModelAndView modelAndView = new ModelAndView("/admin/shop/create.html");
|
||||
modelAndView.addObject("CONTROLLER_NAME", "shop");
|
||||
modelAndView.addObject("ACTION_NAME", "create");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@AdminPermission
|
||||
public String create(@Valid ShopCreateReq shopCreateReq, BindingResult bindingResult) throws BusinessException {
|
||||
if (bindingResult.hasErrors()) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, CommonUtil.processErrorString(bindingResult));
|
||||
}
|
||||
ShopModel shopModel = new ShopModel();
|
||||
shopModel.setIconUrl(shopCreateReq.getIconUrl());
|
||||
shopModel.setAddress(shopCreateReq.getAddress());
|
||||
shopModel.setCategoryId(shopCreateReq.getCategoryId());
|
||||
shopModel.setEndTime(shopCreateReq.getEndTime());
|
||||
shopModel.setStartTime(shopCreateReq.getStartTime());
|
||||
shopModel.setLongitude(shopCreateReq.getLongitude());
|
||||
shopModel.setLatitude(shopCreateReq.getLatitude());
|
||||
shopModel.setName(shopCreateReq.getName());
|
||||
shopModel.setPricePerMan(shopCreateReq.getPricePerMan());
|
||||
shopModel.setSellerId(shopCreateReq.getSellerId());
|
||||
shopService.create(shopModel);
|
||||
return "redirect:/admin/shop/index";
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.recommend.dal;
|
||||
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CategoryModelMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
List<CategoryModel> selectAll();
|
||||
|
||||
Integer countAllCategory();
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
int insert(CategoryModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
int insertSelective(CategoryModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
CategoryModel selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
int updateByPrimaryKeySelective(CategoryModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table category
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
int updateByPrimaryKey(CategoryModel record);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.recommend.dal;
|
||||
|
||||
import com.example.recommend.model.ShopModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopModelMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
Integer countAllShop();
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
int insert(ShopModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
int insertSelective(ShopModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
ShopModel selectByPrimaryKey(Integer id);
|
||||
|
||||
List<ShopModel> selectAll();
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
int updateByPrimaryKeySelective(ShopModel record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table shop
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
int updateByPrimaryKey(ShopModel record);
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.example.recommend.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CategoryModel {
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.created_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.updated_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.name
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.icon_url
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private String iconUrl;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column category.sort
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.id
|
||||
*
|
||||
* @return the value of category.id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.id
|
||||
*
|
||||
* @param id the value for category.id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.created_at
|
||||
*
|
||||
* @return the value of category.created_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.created_at
|
||||
*
|
||||
* @param createdAt the value for category.created_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.updated_at
|
||||
*
|
||||
* @return the value of category.updated_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.updated_at
|
||||
*
|
||||
* @param updatedAt the value for category.updated_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.name
|
||||
*
|
||||
* @return the value of category.name
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.name
|
||||
*
|
||||
* @param name the value for category.name
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.icon_url
|
||||
*
|
||||
* @return the value of category.icon_url
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.icon_url
|
||||
*
|
||||
* @param iconUrl the value for category.icon_url
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl == null ? null : iconUrl.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column category.sort
|
||||
*
|
||||
* @return the value of category.sort
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column category.sort
|
||||
*
|
||||
* @param sort the value for category.sort
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 12:22:57 CST 2023
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
}
|
@ -0,0 +1,484 @@
|
||||
package com.example.recommend.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class ShopModel {
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.created_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.updated_at
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.name
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.remark_score
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private BigDecimal remarkScore;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.price_per_man
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Integer pricePerMan;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.latitude
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.longitude
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.category_id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Integer categoryId;
|
||||
|
||||
private CategoryModel categoryModel;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.tags
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.start_time
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.end_time
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.address
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.seller_id
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private Integer sellerId;
|
||||
|
||||
private SellerModel sellerModel;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column shop.icon_url
|
||||
*
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
private String iconUrl;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.id
|
||||
*
|
||||
* @return the value of shop.id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.id
|
||||
*
|
||||
* @param id the value for shop.id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public CategoryModel getCategoryModel() {
|
||||
return categoryModel;
|
||||
}
|
||||
|
||||
public void setCategoryModel(CategoryModel categoryModel) {
|
||||
this.categoryModel = categoryModel;
|
||||
}
|
||||
|
||||
public SellerModel getSellerModel() {
|
||||
return sellerModel;
|
||||
}
|
||||
|
||||
public void setSellerModel(SellerModel sellerModel) {
|
||||
this.sellerModel = sellerModel;
|
||||
}
|
||||
|
||||
// public Integer getDistance() {
|
||||
// return distance;
|
||||
// }
|
||||
//
|
||||
// public void setDistance(Integer distance) {
|
||||
// this.distance = distance;
|
||||
// }
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.created_at
|
||||
*
|
||||
* @return the value of shop.created_at
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.created_at
|
||||
*
|
||||
* @param createdAt the value for shop.created_at
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.updated_at
|
||||
*
|
||||
* @return the value of shop.updated_at
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.updated_at
|
||||
*
|
||||
* @param updatedAt the value for shop.updated_at
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.name
|
||||
*
|
||||
* @return the value of shop.name
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.name
|
||||
*
|
||||
* @param name the value for shop.name
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.remark_score
|
||||
*
|
||||
* @return the value of shop.remark_score
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public BigDecimal getRemarkScore() {
|
||||
return remarkScore;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.remark_score
|
||||
*
|
||||
* @param remarkScore the value for shop.remark_score
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setRemarkScore(BigDecimal remarkScore) {
|
||||
this.remarkScore = remarkScore;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.price_per_man
|
||||
*
|
||||
* @return the value of shop.price_per_man
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Integer getPricePerMan() {
|
||||
return pricePerMan;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.price_per_man
|
||||
*
|
||||
* @param pricePerMan the value for shop.price_per_man
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setPricePerMan(Integer pricePerMan) {
|
||||
this.pricePerMan = pricePerMan;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.latitude
|
||||
*
|
||||
* @return the value of shop.latitude
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public BigDecimal getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.latitude
|
||||
*
|
||||
* @param latitude the value for shop.latitude
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setLatitude(BigDecimal latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.longitude
|
||||
*
|
||||
* @return the value of shop.longitude
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public BigDecimal getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.longitude
|
||||
*
|
||||
* @param longitude the value for shop.longitude
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setLongitude(BigDecimal longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.category_id
|
||||
*
|
||||
* @return the value of shop.category_id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Integer getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.category_id
|
||||
*
|
||||
* @param categoryId the value for shop.category_id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setCategoryId(Integer categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.tags
|
||||
*
|
||||
* @return the value of shop.tags
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.tags
|
||||
*
|
||||
* @param tags the value for shop.tags
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags == null ? null : tags.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.start_time
|
||||
*
|
||||
* @return the value of shop.start_time
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.start_time
|
||||
*
|
||||
* @param startTime the value for shop.start_time
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime == null ? null : startTime.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.end_time
|
||||
*
|
||||
* @return the value of shop.end_time
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.end_time
|
||||
*
|
||||
* @param endTime the value for shop.end_time
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime == null ? null : endTime.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.address
|
||||
*
|
||||
* @return the value of shop.address
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.address
|
||||
*
|
||||
* @param address the value for shop.address
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setAddress(String address) {
|
||||
this.address = address == null ? null : address.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.seller_id
|
||||
*
|
||||
* @return the value of shop.seller_id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public Integer getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.seller_id
|
||||
*
|
||||
* @param sellerId the value for shop.seller_id
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setSellerId(Integer sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column shop.icon_url
|
||||
*
|
||||
* @return the value of shop.icon_url
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column shop.icon_url
|
||||
*
|
||||
* @param iconUrl the value for shop.icon_url
|
||||
* @mbg.generated Tue Oct 10 13:20:51 CST 2023
|
||||
*/
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl == null ? null : iconUrl.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.example.recommend.request;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public class CategoryCreateReq {
|
||||
|
||||
@NotBlank(message = "名字不能为空")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "iconUrl不能为空")
|
||||
private String iconUrl;
|
||||
|
||||
@NotNull(message = "权重不能为空")
|
||||
private Integer sort;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
package com.example.recommend.request;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ShopCreateReq {
|
||||
|
||||
@NotBlank(message = "服务名不能为空")
|
||||
private String name;
|
||||
|
||||
@NotNull(message = "人均价格不能为空")
|
||||
private Integer pricePerMan;
|
||||
|
||||
@NotNull(message = "纬度不能为空")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@NotNull(message = "经度不能为空")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@NotNull(message = "服务类目不能为空")
|
||||
private Integer categoryId;
|
||||
|
||||
private String tags;
|
||||
|
||||
@NotBlank(message = "营业开始时间不能为空")
|
||||
private String startTime;
|
||||
|
||||
@NotBlank(message = "营业结束时间不能为空")
|
||||
private String endTime;
|
||||
|
||||
@NotBlank(message = "地址不能为空")
|
||||
private String address;
|
||||
|
||||
@NotNull(message = "商家ID不能为空")
|
||||
private Integer sellerId;
|
||||
|
||||
@NotBlank(message = "图标不能为空")
|
||||
private String iconUrl;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getPricePerMan() {
|
||||
return pricePerMan;
|
||||
}
|
||||
|
||||
public void setPricePerMan(Integer pricePerMan) {
|
||||
this.pricePerMan = pricePerMan;
|
||||
}
|
||||
|
||||
public BigDecimal getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(BigDecimal latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public BigDecimal getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(BigDecimal longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public Integer getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(Integer categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Integer getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
public void setSellerId(Integer sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.example.recommend.service;
|
||||
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CategoryService {
|
||||
|
||||
CategoryModel create(CategoryModel categoryModel) throws BusinessException;
|
||||
|
||||
CategoryModel get(Integer id);
|
||||
|
||||
List<CategoryModel> selectAll();
|
||||
|
||||
Integer countAllCategory();
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.example.recommend.service;
|
||||
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.model.ShopModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopService {
|
||||
|
||||
ShopModel create(ShopModel shopModel) throws BusinessException;
|
||||
|
||||
ShopModel get(Integer id);
|
||||
|
||||
List<ShopModel> selectAll();
|
||||
|
||||
//List<ShopModel> recommend(BigDecimal longitude, BigDecimal latitude);
|
||||
|
||||
//List<Map<String, Object>> searchGroupByTags(String keyword, Integer categoryId, String tags);
|
||||
|
||||
Integer countAllShop();
|
||||
|
||||
//List<ShopModel> search(BigDecimal longitude, BigDecimal latitude,String keyword, Integer orderby, Integer categoryId, String tags);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.example.recommend.service.impl;
|
||||
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.common.EmBusinessError;
|
||||
import com.example.recommend.dal.CategoryModelMapper;
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
import com.example.recommend.service.CategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CategoryServiceImpl implements CategoryService {
|
||||
|
||||
@Autowired
|
||||
private CategoryModelMapper categoryModelMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CategoryModel create(CategoryModel categoryModel) throws BusinessException {
|
||||
categoryModel.setCreatedAt(new Date());
|
||||
categoryModel.setUpdatedAt(new Date());
|
||||
try {
|
||||
categoryModelMapper.insertSelective(categoryModel);
|
||||
} catch (DuplicateKeyException ex) {
|
||||
throw new BusinessException(EmBusinessError.CATEGORY_NAME_DUPLICATED);
|
||||
}
|
||||
return get(categoryModel.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryModel get(Integer id) {
|
||||
return categoryModelMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoryModel> selectAll() {
|
||||
return categoryModelMapper.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countAllCategory() {
|
||||
return categoryModelMapper.countAllCategory();
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.example.recommend.service.impl;
|
||||
|
||||
import com.example.recommend.common.BusinessException;
|
||||
import com.example.recommend.common.EmBusinessError;
|
||||
import com.example.recommend.dal.ShopModelMapper;
|
||||
import com.example.recommend.model.CategoryModel;
|
||||
import com.example.recommend.model.SellerModel;
|
||||
import com.example.recommend.model.ShopModel;
|
||||
import com.example.recommend.service.CategoryService;
|
||||
import com.example.recommend.service.SellerService;
|
||||
import com.example.recommend.service.ShopService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Autowired
|
||||
private ShopModelMapper shopModelMapper;
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Autowired
|
||||
private SellerService sellerService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ShopModel create(ShopModel shopModel) throws BusinessException {
|
||||
shopModel.setCreatedAt(new Date());
|
||||
shopModel.setUpdatedAt(new Date());
|
||||
|
||||
//校验商家是否存在正确
|
||||
SellerModel sellerModel = sellerService.get(shopModel.getSellerId());
|
||||
if (sellerModel == null) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, "商户不存在");
|
||||
}
|
||||
|
||||
if (sellerModel.getDisabledFlag().intValue() == 1) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, "商户已禁用");
|
||||
}
|
||||
|
||||
//校验类目
|
||||
CategoryModel categoryModel = categoryService.get(shopModel.getCategoryId());
|
||||
if (categoryModel == null) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, "类目不存在");
|
||||
}
|
||||
shopModelMapper.insertSelective(shopModel);
|
||||
|
||||
return get(shopModel.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopModel get(Integer id) {
|
||||
ShopModel shopModel = shopModelMapper.selectByPrimaryKey(id);
|
||||
if (shopModel == null) {
|
||||
return null;
|
||||
}
|
||||
shopModel.setSellerModel(sellerService.get(shopModel.getSellerId()));
|
||||
shopModel.setCategoryModel(categoryService.get(shopModel.getCategoryId()));
|
||||
return shopModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopModel> selectAll() {
|
||||
List<ShopModel> shopModelList = shopModelMapper.selectAll();
|
||||
shopModelList.forEach(shopModel -> {
|
||||
shopModel.setSellerModel(sellerService.get(shopModel.getSellerId()));
|
||||
shopModel.setCategoryModel(categoryService.get(shopModel.getCategoryId()));
|
||||
});
|
||||
return shopModelList;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<ShopModel> recommend(BigDecimal longitude, BigDecimal latitude) {
|
||||
// List<ShopModel> shopModelList = shopModelMapper.recommend(longitude, latitude);
|
||||
// shopModelList.forEach(shopModel -> {
|
||||
// shopModel.setSellerModel(sellerService.get(shopModel.getSellerId()));
|
||||
// shopModel.setCategoryModel(categoryService.get(shopModel.getCategoryId()));
|
||||
// });
|
||||
// return shopModelList;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public List<Map<String, Object>> searchGroupByTags(String keyword, Integer categoryId, String tags) {
|
||||
// return shopModelMapper.searchGroupByTags(keyword, categoryId, tags);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Integer countAllShop() {
|
||||
return shopModelMapper.countAllShop();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<ShopModel> search(BigDecimal longitude,
|
||||
// BigDecimal latitude, String keyword, Integer orderby,
|
||||
// Integer categoryId, String tags) {
|
||||
// List<ShopModel> shopModelList = shopModelMapper.search(longitude, latitude, keyword, orderby, categoryId, tags);
|
||||
// shopModelList.forEach(shopModel -> {
|
||||
// shopModel.setSellerModel(sellerService.get(shopModel.getSellerId()));
|
||||
// shopModel.setCategoryModel(categoryService.get(shopModel.getCategoryId()));
|
||||
// });
|
||||
// return shopModelList;
|
||||
// }
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
<?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.example.recommend.dal.CategoryModelMapper">
|
||||
<resultMap id="BaseResultMap" type="com.example.recommend.model.CategoryModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="icon_url" jdbcType="VARCHAR" property="iconUrl"/>
|
||||
<result column="sort" jdbcType="INTEGER" property="sort"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
id, created_at, updated_at, name, icon_url, sort
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from category
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
delete from category
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.example.recommend.model.CategoryModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into category (created_at, updated_at, name,
|
||||
icon_url, sort)
|
||||
values (#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR},
|
||||
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.example.recommend.model.CategoryModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
icon_url,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
#{iconUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.example.recommend.model.CategoryModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
update category
|
||||
<set>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
icon_url = #{iconUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.example.recommend.model.CategoryModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 12:22:57 CST 2023.
|
||||
-->
|
||||
update category
|
||||
set created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
icon_url = #{iconUrl,jdbcType=VARCHAR},
|
||||
sort = #{sort,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from category order by sort DESC,id ASC
|
||||
</select>
|
||||
<select id="countAllCategory" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from category
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,259 @@
|
||||
<?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.example.recommend.dal.ShopModelMapper">
|
||||
<resultMap id="BaseResultMap" type="com.example.recommend.model.ShopModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="remark_score" jdbcType="DECIMAL" property="remarkScore"/>
|
||||
<result column="price_per_man" jdbcType="INTEGER" property="pricePerMan"/>
|
||||
<result column="latitude" jdbcType="DECIMAL" property="latitude"/>
|
||||
<result column="longitude" jdbcType="DECIMAL" property="longitude"/>
|
||||
<result column="category_id" jdbcType="INTEGER" property="categoryId"/>
|
||||
<result column="tags" jdbcType="VARCHAR" property="tags"/>
|
||||
<result column="start_time" jdbcType="VARCHAR" property="startTime"/>
|
||||
<result column="end_time" jdbcType="VARCHAR" property="endTime"/>
|
||||
<result column="address" jdbcType="VARCHAR" property="address"/>
|
||||
<result column="seller_id" jdbcType="INTEGER" property="sellerId"/>
|
||||
<result column="icon_url" jdbcType="VARCHAR" property="iconUrl"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
id, created_at, updated_at, name, remark_score, price_per_man, latitude, longitude,
|
||||
category_id, tags, start_time, end_time, address, seller_id, icon_url
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from shop
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
delete from shop
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.example.recommend.model.ShopModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into shop (created_at, updated_at, name,
|
||||
remark_score, price_per_man, latitude,
|
||||
longitude, category_id, tags,
|
||||
start_time, end_time, address,
|
||||
seller_id, icon_url)
|
||||
values (#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR},
|
||||
#{remarkScore,jdbcType=DECIMAL}, #{pricePerMan,jdbcType=INTEGER}, #{latitude,jdbcType=DECIMAL},
|
||||
#{longitude,jdbcType=DECIMAL}, #{categoryId,jdbcType=INTEGER}, #{tags,jdbcType=VARCHAR},
|
||||
#{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
||||
#{sellerId,jdbcType=INTEGER}, #{iconUrl,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.example.recommend.model.ShopModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into shop
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="remarkScore != null">
|
||||
remark_score,
|
||||
</if>
|
||||
<if test="pricePerMan != null">
|
||||
price_per_man,
|
||||
</if>
|
||||
<if test="latitude != null">
|
||||
latitude,
|
||||
</if>
|
||||
<if test="longitude != null">
|
||||
longitude,
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
category_id,
|
||||
</if>
|
||||
<if test="tags != null">
|
||||
tags,
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="sellerId != null">
|
||||
seller_id,
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
icon_url,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remarkScore != null">
|
||||
#{remarkScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="pricePerMan != null">
|
||||
#{pricePerMan,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="latitude != null">
|
||||
#{latitude,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="longitude != null">
|
||||
#{longitude,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
#{categoryId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="tags != null">
|
||||
#{tags,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
#{startTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sellerId != null">
|
||||
#{sellerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
#{iconUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.example.recommend.model.ShopModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
update shop
|
||||
<set>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remarkScore != null">
|
||||
remark_score = #{remarkScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="pricePerMan != null">
|
||||
price_per_man = #{pricePerMan,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="latitude != null">
|
||||
latitude = #{latitude,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="longitude != null">
|
||||
longitude = #{longitude,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
category_id = #{categoryId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="tags != null">
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time = #{startTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sellerId != null">
|
||||
seller_id = #{sellerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="iconUrl != null">
|
||||
icon_url = #{iconUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.example.recommend.model.ShopModel">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Oct 10 13:20:51 CST 2023.
|
||||
-->
|
||||
update shop
|
||||
set created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
remark_score = #{remarkScore,jdbcType=DECIMAL},
|
||||
price_per_man = #{pricePerMan,jdbcType=INTEGER},
|
||||
latitude = #{latitude,jdbcType=DECIMAL},
|
||||
longitude = #{longitude,jdbcType=DECIMAL},
|
||||
category_id = #{categoryId,jdbcType=INTEGER},
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
start_time = #{startTime,jdbcType=VARCHAR},
|
||||
end_time = #{endTime,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
seller_id = #{sellerId,jdbcType=INTEGER},
|
||||
icon_url = #{iconUrl,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from shop order by id ASC
|
||||
</select>
|
||||
<select id="countAllShop" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from shop
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
|
||||
Version: 2.0.2
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<!--[if IE 8]>
|
||||
<html lang="en" class="ie8 no-js"> <![endif]-->
|
||||
<!--[if IE 9]>
|
||||
<html lang="en" class="ie9 no-js"> <![endif]-->
|
||||
<!--[if !IE]><!-->
|
||||
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
<!--<![endif]-->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>运营平台</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta content="" name="description"/>
|
||||
<meta content="" name="author"/>
|
||||
<!-- BEGIN GLOBAL MANDATORY STYLES -->
|
||||
<link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END GLOBAL MANDATORY STYLES -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
|
||||
<link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE LEVEL PLUGIN STYLES -->
|
||||
<!-- BEGIN PAGE STYLES -->
|
||||
<link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE STYLES -->
|
||||
<!-- BEGIN THEME STYLES -->
|
||||
<link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
|
||||
<link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END THEME STYLES -->
|
||||
<link rel="shortcut icon" href="/public/favicon.ico"/>
|
||||
<script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
<style>
|
||||
.errMsg {
|
||||
display: none;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<!-- END HEAD -->
|
||||
<!-- BEGIN BODY -->
|
||||
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
|
||||
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
|
||||
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
|
||||
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
|
||||
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
|
||||
<body class="page-header-fixed ">
|
||||
|
||||
<header th:replace="admin/common/header :: header"></header>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<div class="page-container">
|
||||
<div th:replace="admin/common/sidebar :: sidebar"></div>
|
||||
<!-- BEGIN CONTENT -->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">创建品类</h3>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form action="/admin/category/create" id="create" class="form-horizontal form-row-seperated"
|
||||
method="post">
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">品类名<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="name" id="name" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">图片url路径<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="iconUrl" id="iconUrl" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">权重<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="sort" id="sort" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions fluid nobg">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<button type="submit" class="btn yellow-lemon" id="saveButton"><i class="fa fa-check"></i>
|
||||
创建
|
||||
</button>
|
||||
<button type="button" class="btn default" style="margin-left:12px;"
|
||||
onclick="javascript:history.go(-1)"> 取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<footer th:replace="admin/common/footer :: footer"></footer>
|
||||
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
|
||||
<!-- BEGIN CORE PLUGINS -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/assets/global/plugins/respond.min.js"></script>
|
||||
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
|
||||
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
|
||||
type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
|
||||
<!-- END CORE PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
||||
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL SCRIPTS -->
|
||||
<script>
|
||||
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
Metronic.init(); // init metronic core componets
|
||||
Layout.init(); // init layout
|
||||
Index.init();
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,398 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
|
||||
Version: 2.0.2
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@ke<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
|
||||
Version: 2.0.2
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
|
||||
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
|
||||
<!--[if !IE]><!-->
|
||||
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
<!--<![endif]-->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>运营后台</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta content="" name="description"/>
|
||||
<meta content="" name="author"/>
|
||||
<!-- BEGIN GLOBAL MANDATORY STYLES -->
|
||||
<link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END GLOBAL MANDATORY STYLES -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
|
||||
<link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE LEVEL PLUGIN STYLES -->
|
||||
<!-- BEGIN PAGE STYLES -->
|
||||
<link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE STYLES -->
|
||||
<!-- BEGIN THEME STYLES -->
|
||||
<link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
|
||||
<link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END THEME STYLES -->
|
||||
<link rel="shortcut icon" href="/static/favicon.ico"/>
|
||||
<style type="text/css">
|
||||
.userAvatat{
|
||||
width:32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<!-- END HEAD -->
|
||||
<!-- BEGIN BODY -->
|
||||
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
|
||||
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
|
||||
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
|
||||
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
|
||||
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
|
||||
<body class="page-header-fixed ">
|
||||
|
||||
<header th:replace="admin/common/header :: header"></header>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<div class="page-container">
|
||||
<div th:replace="admin/common/sidebar :: sidebar"></div>
|
||||
<!-- BEGIN CONTENT -->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
品类管理
|
||||
</h3>
|
||||
<div class="row" style="margin:20px 0 20px 0;">
|
||||
<button type="button" class="btn green add">添加品类 <i class="m-icon-swapright m-icon-white"></i></button>
|
||||
</div>
|
||||
|
||||
<!-- END PAGE TITLE & BREADCRUMB-->
|
||||
<div class="row">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>品类列表
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>品类名</th>
|
||||
<th>icon图片</th>
|
||||
<th>排序权重</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="category:${data.list}">
|
||||
<td th:text="${category.id}"></td>
|
||||
<td th:text="${category.name}"></td>
|
||||
<td><img style="width:60px;height:60px;" th:src="${category.iconUrl}"/></td>
|
||||
<td th:text="${category.sort}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="page-container" class="pagination"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE CONTENT-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<footer th:replace="admin/common/footer :: footer"></footer>
|
||||
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
|
||||
<!-- BEGIN CORE PLUGINS -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/assets/global/plugins/respond.min.js"></script>
|
||||
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
|
||||
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
|
||||
<!-- END CORE PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
|
||||
<script src="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
||||
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/pagination.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL SCRIPTS -->
|
||||
<script th:inline="javascript">
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
Metronic.init(); // init metronic core componets
|
||||
Layout.init(); // init layout
|
||||
Index.init();
|
||||
var baseUrl = "/admin/category/index?page="
|
||||
setUrl(baseUrl);
|
||||
var totalSize = /*[[${data.total}]]*/;
|
||||
var countPerPage = /*[[${data.pageSize}]]*/;
|
||||
var allPage = /*[[${data.pages}]]*/;
|
||||
setPage(document.getElementById("page-container"),allPage,/*[[${currentPage}]]*/);
|
||||
if(allPage <= 1){
|
||||
$("#page-container").hide();
|
||||
}
|
||||
|
||||
$(".add").on("click", function(){
|
||||
window.location.href = "/admin/category/createpage";
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- END JAVASCRIPTS -->
|
||||
</body>
|
||||
<!-- END BODY -->
|
||||
</html>enthemes.com
|
||||
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
|
||||
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
|
||||
<!--[if !IE]><!-->
|
||||
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
<!--<![endif]-->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>运营后台</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta content="" name="description"/>
|
||||
<meta content="" name="author"/>
|
||||
<!-- BEGIN GLOBAL MANDATORY STYLES -->
|
||||
<link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END GLOBAL MANDATORY STYLES -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
|
||||
<link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE LEVEL PLUGIN STYLES -->
|
||||
<!-- BEGIN PAGE STYLES -->
|
||||
<link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE STYLES -->
|
||||
<!-- BEGIN THEME STYLES -->
|
||||
<link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
|
||||
<link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END THEME STYLES -->
|
||||
<link rel="shortcut icon" href="/static/favicon.ico"/>
|
||||
<style type="text/css">
|
||||
.userAvatat{
|
||||
width:32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<!-- END HEAD -->
|
||||
<!-- BEGIN BODY -->
|
||||
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
|
||||
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
|
||||
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
|
||||
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
|
||||
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
|
||||
<body class="page-header-fixed ">
|
||||
|
||||
<header th:replace="admin/common/header :: header"></header>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<div class="page-container">
|
||||
<div th:replace="admin/common/sidebar :: sidebar"></div>
|
||||
<!-- BEGIN CONTENT -->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
品类管理
|
||||
</h3>
|
||||
<div class="row" style="margin:20px 0 20px 0;">
|
||||
<button type="button" class="btn green add">添加品类 <i class="m-icon-swapright m-icon-white"></i></button>
|
||||
</div>
|
||||
|
||||
<!-- END PAGE TITLE & BREADCRUMB-->
|
||||
<div class="row">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>品类列表
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>品类名</th>
|
||||
<th>icon图片</th>
|
||||
<th>排序权重</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="category:${data.list}">
|
||||
<td th:text="${category.id}"></td>
|
||||
<td th:text="${category.name}"></td>
|
||||
<td><img style="width:60px;height:60px;" th:src="${category.iconUrl}"/></td>
|
||||
<td th:text="${category.sort}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="page-container" class="pagination"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE CONTENT-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<footer th:replace="admin/common/footer :: footer"></footer>
|
||||
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
|
||||
<!-- BEGIN CORE PLUGINS -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/assets/global/plugins/respond.min.js"></script>
|
||||
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
|
||||
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
|
||||
<!-- END CORE PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
|
||||
<script src="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
||||
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/pagination.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL SCRIPTS -->
|
||||
<script th:inline="javascript">
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
Metronic.init(); // init metronic core componets
|
||||
Layout.init(); // init layout
|
||||
Index.init();
|
||||
var baseUrl = "/admin/category/index?page="
|
||||
setUrl(baseUrl);
|
||||
var totalSize = /*[[${data.total}]]*/;
|
||||
var countPerPage = /*[[${data.pageSize}]]*/;
|
||||
var currentPage = /*[[${data.pageNum}]]*/;
|
||||
var allPage = /*[[${data.pages}]]*/;
|
||||
setPage(document.getElementById("page-container"),allPage,currentPage);
|
||||
if(allPage <= 1){
|
||||
$("#page-container").hide();
|
||||
}
|
||||
|
||||
$(".add").on("click", function(){
|
||||
window.location.href = "/admin/category/createpage";
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- END JAVASCRIPTS -->
|
||||
</body>
|
||||
<!-- END BODY -->
|
||||
</html>
|
@ -0,0 +1,255 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
|
||||
Version: 2.0.2
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<!--[if IE 8]>
|
||||
<html lang="en" class="ie8 no-js"> <![endif]-->
|
||||
<!--[if IE 9]>
|
||||
<html lang="en" class="ie9 no-js"> <![endif]-->
|
||||
<!--[if !IE]><!-->
|
||||
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
<!--<![endif]-->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>运营平台</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta content="" name="description"/>
|
||||
<meta content="" name="author"/>
|
||||
<!-- BEGIN GLOBAL MANDATORY STYLES -->
|
||||
<link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END GLOBAL MANDATORY STYLES -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
|
||||
<link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE LEVEL PLUGIN STYLES -->
|
||||
<!-- BEGIN PAGE STYLES -->
|
||||
<link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE STYLES -->
|
||||
<!-- BEGIN THEME STYLES -->
|
||||
<link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
|
||||
<link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END THEME STYLES -->
|
||||
<link rel="shortcut icon" href="/public/favicon.ico"/>
|
||||
<script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
<style>
|
||||
.errMsg {
|
||||
display: none;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<!-- END HEAD -->
|
||||
<!-- BEGIN BODY -->
|
||||
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
|
||||
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
|
||||
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
|
||||
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
|
||||
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
|
||||
<body class="page-header-fixed ">
|
||||
|
||||
<header th:replace="admin/common/header :: header"></header>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<div class="page-container">
|
||||
<div th:replace="admin/common/sidebar :: sidebar"></div>
|
||||
<!-- BEGIN CONTENT -->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">创建门店</h3>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form action="/admin/shop/create" id="create" class="form-horizontal form-row-seperated" method="post">
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">门店icon图片路径<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="iconUrl" id="iconUrl" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">门店名<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="name" id="name" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">人均价格<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="pricePerMan" id="pricePerMan" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">地址<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="address" id="address" value="" class="form-control"/>
|
||||
</div>
|
||||
<button type="button" id="analyze" class="btn default" style="margin-left:12px;">
|
||||
解析经纬度
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">经度<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="longitude" id="longitude" value="" readonly
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">纬度<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="latitude" id="latitude" value="" readonly
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">品类ID<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="categoryId" id="categoryId" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">标签<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="tags" id="tags" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">开始营业时间(格式08:00)<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="startTime" id="startTime" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">结束营业时间(格式22:00)<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="endTime" id="endTime" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">商家ID<span class="required"
|
||||
aria-required="true"></span></label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="sellerId" id="sellerId" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions fluid nobg">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<button type="submit" class="btn yellow-lemon" id="saveButton"><i class="fa fa-check"></i>
|
||||
创建
|
||||
</button>
|
||||
<button type="button" class="btn default" style="margin-left:12px;"
|
||||
onclick="javascript:history.go(-1)"> 取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<footer th:replace="admin/common/footer :: footer"></footer>
|
||||
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
|
||||
<!-- BEGIN CORE PLUGINS -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/assets/global/plugins/respond.min.js"></script>
|
||||
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
|
||||
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
|
||||
type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
|
||||
<!-- END CORE PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
||||
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL SCRIPTS -->
|
||||
<script>
|
||||
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
Metronic.init(); // init metronic core componets
|
||||
Layout.init(); // init layout
|
||||
Index.init();
|
||||
getFloat = function (number, n) {
|
||||
n = n ? parseInt(n) : 0;
|
||||
if (n <= 0) return Math.round(number);
|
||||
number = Math.round(number * Math.pow(10, n)) / Math.pow(10, n);
|
||||
return number;
|
||||
};
|
||||
|
||||
$("#analyze").on("click", function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "http://api.map.baidu.com/geocoder/v2/",
|
||||
data: "address=" + encodeURIComponent($("#address").val()) + "&output=json&ak=9wV8VNAp1qm8FLQzVZ70dcIS6HNwTXBk",
|
||||
dataType: "jsonp",
|
||||
jsonp: "callback",
|
||||
jsonpCallback: "showLocation",
|
||||
success: function (data) {
|
||||
if (data.status == 0) {
|
||||
alert("地址解析成功");
|
||||
$("#latitude").val(getFloat(data.result.location.lat, 6));
|
||||
$("#longitude").val(getFloat(data.result.location.lng, 6));
|
||||
} else {
|
||||
alert("获取百度地图失败,原因为" + data);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
alert("获取百度地图失败,原因为" + data.responseText);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,235 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
|
||||
Version: 2.0.2
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
|
||||
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
|
||||
<!--[if !IE]><!-->
|
||||
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
<!--<![endif]-->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>运营后台</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta content="" name="description"/>
|
||||
<meta content="" name="author"/>
|
||||
<!-- BEGIN GLOBAL MANDATORY STYLES -->
|
||||
<link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END GLOBAL MANDATORY STYLES -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
|
||||
<link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE LEVEL PLUGIN STYLES -->
|
||||
<!-- BEGIN PAGE STYLES -->
|
||||
<link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END PAGE STYLES -->
|
||||
<!-- BEGIN THEME STYLES -->
|
||||
<link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
|
||||
<link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- END THEME STYLES -->
|
||||
<link rel="shortcut icon" href="/static/favicon.ico"/>
|
||||
<style type="text/css">
|
||||
.userAvatat{
|
||||
width:32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<!-- END HEAD -->
|
||||
<!-- BEGIN BODY -->
|
||||
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
|
||||
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
|
||||
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
|
||||
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
|
||||
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
|
||||
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
|
||||
<body class="page-header-fixed ">
|
||||
|
||||
<header th:replace="admin/common/header :: header"></header>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
<!-- BEGIN CONTAINER -->
|
||||
<div class="page-container">
|
||||
<div th:replace="admin/common/sidebar :: sidebar"></div>
|
||||
<!-- BEGIN CONTENT -->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
门店管理
|
||||
</h3>
|
||||
<div class="row" style="margin:20px 0 20px 0;">
|
||||
<button type="button" class="btn green add">添加门店 <i class="m-icon-swapright m-icon-white"></i></button>
|
||||
</div>
|
||||
|
||||
<!-- END PAGE TITLE & BREADCRUMB-->
|
||||
<div class="row">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>品类门店
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>图标</th>
|
||||
<th>门店名</th>
|
||||
<th>评分</th>
|
||||
<th>人均价格</th>
|
||||
<th>品类信息</th>
|
||||
<th>标签</th>
|
||||
<th>开始营业时间</th>
|
||||
<th>结束营业时间</th>
|
||||
<th>地址</th>
|
||||
<th>商家信息</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="shop:${data.list}">
|
||||
<td th:text="${shop.id}"></td>
|
||||
<td><img style="width:40px;height:40px;" th:src="${shop.iconUrl}"/></td>
|
||||
<td th:text="${shop.name}"></td>
|
||||
<td th:text="${shop.remarkScore}"</td>
|
||||
<td th:text="${shop.pricePerMan}"</td>
|
||||
<td th:text="${shop.categoryModel.name}"></td>
|
||||
<td th:text="${shop.tags}"></td>
|
||||
<td th:text="${shop.startTime}"></td>
|
||||
<td th:text="${shop.endTime}"></td>
|
||||
<td th:text="${shop.address}"></td>
|
||||
<td th:text="${shop.sellerModel.name}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="page-container" class="pagination"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE CONTENT-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<footer th:replace="admin/common/footer :: footer"></footer>
|
||||
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
|
||||
<!-- BEGIN CORE PLUGINS -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/assets/global/plugins/respond.min.js"></script>
|
||||
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
|
||||
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
|
||||
<!-- END CORE PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
|
||||
<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
|
||||
<script src="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL PLUGINS -->
|
||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
||||
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/global/scripts/pagination.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
|
||||
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
|
||||
<!-- END PAGE LEVEL SCRIPTS -->
|
||||
<script th:inline="javascript">
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
Metronic.init(); // init metronic core componets
|
||||
Layout.init(); // init layout
|
||||
Index.init();
|
||||
|
||||
|
||||
|
||||
// var img = new Image();
|
||||
// img.crossOrigin = ""; //跨域
|
||||
// img.src = "https://wx.qxclub.cn/pointshop/confirm/presale/get_image_token.do?time=1560492013790";
|
||||
// img.onload = function() {// 图片加载后执行的方法
|
||||
// var base64 = getBase64Image(img);// 将图片转成base64格式的方法
|
||||
// console.log(base64);
|
||||
// };
|
||||
// function getBase64Image(img){
|
||||
// var canvas = document.createElement("canvas");// 创建一个canvas
|
||||
// canvas.width = img.width; // 设置对应的宽高
|
||||
// canvas.height = img.height;
|
||||
// var ctx = canvas.getContext("2d"); // 二维绘图环境
|
||||
// ctx.drawImage(img, 0, 0, img.width, img.height); // 将图片画在画布上
|
||||
// var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase(); // 获取到图片的格式
|
||||
// var dataURL = canvas.toDataURL("image/" + ext); // 得到base64 编码的 dataURL
|
||||
// return dataURL;
|
||||
// }
|
||||
|
||||
|
||||
var baseUrl = "/admin/shop/index?page="
|
||||
setUrl(baseUrl);
|
||||
var totalSize = /*[[${data.total}]]*/;
|
||||
var countPerPage = /*[[${data.pageSize}]]*/;
|
||||
var allPage = /*[[${data.pages}]]*/;
|
||||
setPage(document.getElementById("page-container"),allPage,/*[[${currentPage}]]*/);
|
||||
if(allPage <= 1){
|
||||
$("#page-container").hide();
|
||||
}
|
||||
|
||||
$(".add").on("click", function(){
|
||||
window.location.href = "/admin/shop/createpage";
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- END JAVASCRIPTS -->
|
||||
</body>
|
||||
<!-- END BODY -->
|
||||
</html>
|
Loading…
Reference in new issue