Documentation ¶
Overview ¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const AccessToken = "879ccb18e49b41cfe6dfb6a524b5cafcec8a7b4d9bdc654600ac297e74b54ab2"
const Screct = "SECa4b103d0ca5ac4e95a6858da40f0b42578db4f665ec73576faeab1ff8d9ef63d"
Variables ¶
var All string = "true"
var FixImageCommand = &cobra.Command{ Use: "fixImage", Short: "Print the version number of Hugo", Long: `All software has versions. This is Hugo's`, Run: func(cmd *cobra.Command, args []string) { dirName, _ := cmd.Flags().GetString("dir") web, _ := cmd.Flags().GetString("web") helpCommon := new(help.Common) pwd, _ := os.Getwd() dir := helpCommon.GetParentDirectory(pwd) // 查询所有图片数据 var page int = 0 httpHelp := new(help.HttpHelp) fix := new(FixCommand) pwdDir := fix.getDirPath(dir, dirName) params := new(request.PersonListParams) PersonService := new(service.FoundPersonService) foundPersonService := new(service.FoundPersonService) count := 10 wg := sync.WaitGroup{} c := make(chan int, count) defer close(c) for { params.UserHeader = web params.Page = 0 params.PageSize = 10 list, _, _ := PersonService.GetPersonList(params) if list == nil { panic("数据抓取完成") } var userHeaderData = service.UserHeaderUpdate{} for k, v := range list.([]*model.CrPersonFound) { fmt.Println(k) go func(k int, v *model.CrPersonFound) { wg.Add(1) c <- 1 fileName := httpHelp.DownImage(pwdDir, v.UserHeader) userHeaderData.UserHeader = fileName fmt.Println(v.Id) foundPersonService.UpdateDateById(v.Id, userHeaderData) defer wg.Done() <-c fmt.Println(k) }(k, v) } page++ wg.Wait() } }, }
Functions ¶
Types ¶
type FixCommand ¶
type FixCommand struct { }