国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

網(wǎng)站運營與管理的目的是合肥網(wǎng)絡推廣公司

網(wǎng)站運營與管理的目的是,合肥網(wǎng)絡推廣公司,秦皇島網(wǎng)站開發(fā)公司,網(wǎng)站的運營需求分析和設計 1.1.1 產(chǎn)品原型 進到蒼穹外賣后臺,顯示餐廳的營業(yè)狀態(tài),營業(yè)狀態(tài)分為營業(yè)中和打烊中,若當前餐廳處于營業(yè)狀態(tài),自動接收任何訂單,客戶可在小程序進行下單操作;若當前餐廳處于打烊狀態(tài)&#…

需求分析和設計

1.1.1 產(chǎn)品原型

進到蒼穹外賣后臺,顯示餐廳的營業(yè)狀態(tài),營業(yè)狀態(tài)分為營業(yè)中打烊中,若當前餐廳處于營業(yè)狀態(tài),自動接收任何訂單,客戶可在小程序進行下單操作;若當前餐廳處于打烊狀態(tài),不接受任何訂單,客戶便無法在小程序進行下單操作。

點擊營業(yè)狀態(tài)按鈕時,彈出更改營業(yè)狀態(tài)

選擇營業(yè),設置餐廳為營業(yè)中狀態(tài)

選擇打烊,設置餐廳為打烊中狀態(tài)

1.1.2 接口設計

根據(jù)上述原型圖設計接口,共包含3個接口。

接口設計:

  • 設置營業(yè)狀態(tài)
  • 管理端查詢營業(yè)狀態(tài)
  • 用戶端查詢營業(yè)狀態(tài)

**注:**從技術(shù)層面分析,其實管理端和用戶端查詢營業(yè)狀態(tài)時,可通過一個接口去實現(xiàn)即可。因為營業(yè)狀態(tài)是一致的。但是,本項目約定:

  • 管理端發(fā)出的請求,統(tǒng)一使用/admin作為前綴。
  • 用戶端發(fā)出的請求,統(tǒng)一使用/user作為前綴。

因為訪問路徑不一致,故分為兩個接口實現(xiàn)。

1.1.3 營業(yè)狀態(tài)存儲方式

雖然,可以通過一張表來存儲營業(yè)狀態(tài)數(shù)據(jù),但整個表中只有一個字段,所以意義不大。

營業(yè)狀態(tài)數(shù)據(jù)存儲方式:基于Redis的字符串來進行存儲

**約定:**1表示營業(yè) 0表示打烊

1.2 代碼開發(fā)

1.2.1 設置營業(yè)狀態(tài)

在sky-server模塊中,創(chuàng)建ShopController.java

根據(jù)接口定義創(chuàng)建ShopController的setStatus設置營業(yè)狀態(tài)方法:

package com.sky.controller.admin;import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController("adminShopController")
@RequestMapping("/admin/shop")
@Api(tags = "店鋪相關(guān)接口")
@Slf4j
public class ShopController {public static final String KEY = "SHOP_STATUS";@Autowiredprivate RedisTemplate redisTemplate;/*** 設置店鋪的營業(yè)狀態(tài)* @param status* @return*/@PutMapping("/{status}")@ApiOperation("設置店鋪的營業(yè)狀態(tài)")public Result setStatus(@PathVariable Integer status){log.info("設置店鋪的營業(yè)狀態(tài)為:{}",status == 1 ? "營業(yè)中" : "打烊中");redisTemplate.opsForValue().set(KEY,status);return Result.success();}
}
1.2.2 管理端查詢營業(yè)狀態(tài)

根據(jù)接口定義創(chuàng)建ShopController的getStatus查詢營業(yè)狀態(tài)方法:

	/*** 獲取店鋪的營業(yè)狀態(tài)* @return*/@GetMapping("/status")@ApiOperation("獲取店鋪的營業(yè)狀態(tài)")public Result<Integer> getStatus(){Integer status = (Integer) redisTemplate.opsForValue().get(KEY);log.info("獲取到店鋪的營業(yè)狀態(tài)為:{}",status == 1 ? "營業(yè)中" : "打烊中");return Result.success(status);}
1.2.3 用戶端查詢營業(yè)狀態(tài)

創(chuàng)建com.sky.controller.user包,在該包下創(chuàng)建ShopController.java

根據(jù)接口定義創(chuàng)建ShopController的getStatus查詢營業(yè)狀態(tài)方法:

package com.sky.controller.user;import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;@RestController("userShopController")
@RequestMapping("/user/shop")
@Api(tags = "店鋪相關(guān)接口")
@Slf4j
public class ShopController {public static final String KEY = "SHOP_STATUS";@Autowiredprivate RedisTemplate redisTemplate;/*** 獲取店鋪的營業(yè)狀態(tài)* @return*/@GetMapping("/status")@ApiOperation("獲取店鋪的營業(yè)狀態(tài)")public Result<Integer> getStatus(){Integer status = (Integer) redisTemplate.opsForValue().get(KEY);log.info("獲取到店鋪的營業(yè)狀態(tài)為:{}",status == 1 ? "營業(yè)中" : "打烊中");return Result.success(status);}
}
``
http://m.aloenet.com.cn/news/41686.html

相關(guān)文章:

  • 青島網(wǎng)頁制作設計營銷寧波如何做seo排名優(yōu)化
  • 馬克杯網(wǎng)站開發(fā)百度seo怎么優(yōu)化
  • 成都企業(yè)網(wǎng)站開發(fā)公司上海app定制開發(fā)公司
  • wordpress添加功能搜索引擎優(yōu)化課程
  • 網(wǎng)站建設設計外包公司網(wǎng)絡營銷的概念與特點
  • 網(wǎng)店怎么開新手寧波seo教程行業(yè)推廣
  • 中國建筑材料網(wǎng)福州seo代理商
  • 陜西省煤炭建設公司第一中學官方網(wǎng)站優(yōu)化網(wǎng)站視頻
  • django網(wǎng)站開發(fā)數(shù)據(jù)分析師資格證書怎么考
  • linux 國外網(wǎng)站網(wǎng)站建設蘇州
  • 石家莊+網(wǎng)站建設近期的時事熱點或新聞事件
  • 南京高端網(wǎng)站建設公司網(wǎng)絡廣告一般是怎么收費
  • 圖書館 網(wǎng)站建設2022拉人頭最暴利的app
  • 海南建設銀行官方網(wǎng)站縱橫seo
  • 濟南哪家公司做網(wǎng)站微信指數(shù)是搜索量嗎
  • 怎么做wordpress主題模板福州seo網(wǎng)絡推廣
  • 刷qq會員自己做網(wǎng)站杭州正規(guī)引流推廣公司
  • 石家莊做網(wǎng)站建設的公司排名百度公司的發(fā)展歷程
  • 免費網(wǎng)站制作公司優(yōu)化網(wǎng)站排名軟件
  • 女子醫(yī)院網(wǎng)站設計怎么做欒城seo整站排名
  • 用rp怎么做網(wǎng)站按鈕下拉菜單免費發(fā)廣告的網(wǎng)站大全
  • 網(wǎng)站建設排期什么是網(wǎng)站推廣?
  • 福州網(wǎng)站建設哪家好班級優(yōu)化大師免費下載安裝
  • 政府網(wǎng)站html5媒體平臺
  • 動態(tài)網(wǎng)站商品瀏覽怎么做seo流量排名軟件
  • 注冊深圳公司的好處惠州抖音seo策劃
  • 網(wǎng)站后臺無法審核怎么把網(wǎng)站排名排上去
  • 近期新冠感染情況吉林網(wǎng)站seo
  • 阿里云域名怎樣做網(wǎng)站百度直播推廣
  • 電商網(wǎng)站建設流程推廣方案是什么