concurrentTest.go 1020 B

123456789101112131415161718192021222324252627282930
  1. package service
  2. import (
  3. "sfis/utils"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func GetConcurrentData(appid string, productId int, c *gin.Context) {
  7. if productId == 1000 {
  8. utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
  9. return ProjectListData(productId, appid, "河南大学", "", "", false)
  10. }, "", "", true)
  11. } else if productId == 1001 {
  12. utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
  13. return ProjectDetailData("5f6bc00c499cb0822d7e3842")
  14. }, "", "", true)
  15. } else if productId == 1002 {
  16. utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
  17. return ProjectListData(productId, appid, "", "中铁十五局集团有限公司", "", true)
  18. }, "", "", true)
  19. } else {
  20. utils.Check(appid, productId, c, func() ([]map[string]interface{}, int, error) {
  21. datas := []map[string]interface{}{map[string]interface{}{
  22. "title": "中铁十五局集团有限公司",
  23. }}
  24. return datas, 200, nil
  25. }, "", "", true)
  26. }
  27. }