user_act_log_test.go 677 B

1234567891011121314151617181920212223242526
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/passport/conf"
  6. "go-common/app/admin/main/passport/model"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestService_DecryptBindLog(t *testing.T) {
  10. config := &conf.Config{
  11. Encode: &conf.Encode{
  12. AesKey: "0123456789abcdef",
  13. Salt: "",
  14. },
  15. }
  16. s := New(config)
  17. convey.Convey("", t, func() {
  18. res, err := s.DecryptBindLog(context.Background(), &model.DecryptBindLogParam{EncryptText: []string{"IsjRu7dmHBY8l7bGf6O3rgDegFvh3cVTgWkf2Bn87Oc="}})
  19. convey.So(err, convey.ShouldBeNil)
  20. convey.So(res["IsjRu7dmHBY8l7bGf6O3rgDegFvh3cVTgWkf2Bn87Oc="], convey.ShouldEqual, "19921218988")
  21. })
  22. }