Code Monkey home page Code Monkey logo

lebron's Issues

mapreduce error

  1. Request Product-Rpc method products mapreduce error
    image

2.Fix: pid is string not int64
image
like this:
image

为什么添加rpc会报如下的错误?

cannot use zrpc.MustNewClient(c.GraphRPC) (value of type "github.com/zeromicro/go-zero/zrpc/internal".Client) as grpc.ClientConnInterface value in argument to graph.NewGraphClient: "github.com/zeromicro/go-zero/zrpc/internal".Client does not implement grpc.ClientConnInterface (missing method Invoke)",

orderitem表结构需要重新更新下

CREATE TABLE `orderitem` (

1.字段按照其他表统一为没有下划线格式
2.id增加AUTO_INCREMENT属性

CREATE TABLE orderitem
(
id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单子表id',
orderid varchar(64) NOT NULL DEFAULT '' COMMENT '订单id',
userid bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户id',
proid bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品id',
proname varchar(100) NOT NULL DEFAULT '' COMMENT '商品名称',
proimage varchar(500) NOT NULL DEFAULT '' COMMENT '商品图片地址',
currentunitprice decimal(20, 2) NOT NULL DEFAULT 0 COMMENT '生成订单时的商品单价,单位是元,保留两位小数',
quantity int(10) NOT NULL DEFAULT 0 COMMENT '商品数量',
totalprice decimal(20, 2) NOT NULL DEFAULT 0 COMMENT '商品总价,单位是元,保留两位小数',
create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (id),
KEY ix_orderid (orderid),
KEY ix_userid (userid),
KEY ix_proid (proid)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='订单明细表';

第五章(缓存代码怎么写)中存在时区问题

例如请求productList(使用grpc请求),
得到的缓存时间戳为1655511521,格式化后为2022-06-18 08:18:41
但是数据库存储的时间为2022-06-18 00:18:41,
这是因为时区存在问题,需要把所有涉及到time.Unix()地方规定时区

go-zero1.5/goctl1.5 OperationProducts失败

使用go-zero1.5/goctl1.5生成ProductOperationModel代码,请求:grpcurl -plaintext -d '{}' 127.0.0.1:8081 product.Product.OperationProducts,OperationProducts方法报错:context.deadlineExceededError {}
image

问题请教

同一个服务,为啥要把rpc api admin分开成多个进程?

放一个里面不行么?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.